Cleanup: restore the interrupt flag in the API client and health checker

Open Beginner friendly
#257 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Rishankgupta08 is already working on this.

Since Nov 14, 2026.

Assessment

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

Research direction

Start with the three named spots: ApiAuth.java around line 117, ApiClient.java around line 142, and ApiHealthChecker.java around line 70, all under src/main/java/com/seleniumboot. In each, find the catch block that swallows InterruptedException and add Thread.currentThread().interrupt() while keeping the existing handling. Done when those three spots restore the flag, behaviour is otherwise unchanged, 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/client/ApiAuth.java: line 117
  • src/main/java/com/seleniumboot/client/ApiClient.java: line 142
  • src/main/java/com/seleniumboot/precondition/ApiHealthChecker.java: line 70

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.