Cleanup: restore the interrupt flag in TestRail / Xray clients

オープン 初心者向け
#256 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
testing-qa

調査の方向性

src/main/java/com/seleniumboot/testmanagement/TestRailClient.java の79行目付近と、XrayClient.java の90行目と110行目から始めてください。ここでは InterruptedException が捕捉されたまま握りつぶされています。それぞれの箇所に、InterruptedException 用の catch を別途追加し、その中で Thread.currentThread().interrupt() を呼び出してください。既存の処理はそのまま残します。これらの箇所で割り込みフラグが復元され、ほかは何も変更されず、mvn test が成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

good first issue

Part of the cleanup cycle from #251. SonarCloud rule java:S2142 flags these spots.

These places catch InterruptedException (often inside catch (Exception e)) and carry on without restoring the thread's interrupt flag. Anything further up that checks Thread.interrupted() (a parallel runner shutting down, a timeout) never sees the interrupt.

Where (line numbers as of master 2a07bba):

  • src/main/java/com/seleniumboot/testmanagement/TestRailClient.java: line 79
  • src/main/java/com/seleniumboot/testmanagement/XrayClient.java: lines 90, 110

Fix: restore the flag and keep the existing behaviour. For a combined catch, split it out:

} catch (InterruptedException e) {
    Thread.currentThread().interrupt();
    // then the same handling the old catch did (log / wrap / return)
} catch (Exception e) {
    ...
}

Done when: the listed spots restore the interrupt flag, the behaviour is otherwise unchanged, and mvn test passes. Keep this PR to this package. SonarCloud reruns on the PR.

主要言語
Java
スター
12
フォーク
6
平均マージ
10時間
マージ済み PR(30日)
76

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

seleniumboot/selenium-boot のほかの issue

seleniumboot/selenium-boot の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。