Cleanup: restore the interrupt flag in TestRail / Xray clients

Open Beginner friendly
#256 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
testing-qa

Research direction

Start in src/main/java/com/seleniumboot/testmanagement/TestRailClient.java around line 79 and in XrayClient.java at lines 90 and 110, where InterruptedException is caught and swallowed. In each spot, add a separate catch for InterruptedException that calls Thread.currentThread().interrupt() and keeps the existing handling. Done when those spots restore the flag, nothing else changes, and mvn test passes.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Java
Stars
12
Forks
6
Avg merge
10h
Merged PRs (30d)
76

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seleniumboot/selenium-boot

All issues in seleniumboot/selenium-boot

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.