Skip to content

fix(build): stabilize the token-store rename retry test - #97

Open
mtopolnik wants to merge 1 commit into
mainfrom
fix/token-store-rename-retry
Open

fix(build): stabilize the token-store rename retry test#97
mtopolnik wants to merge 1 commit into
mainfrom
fix/token-store-rename-retry

Conversation

@mtopolnik

@mtopolnik mtopolnik commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix a timing-sensitive token-store test that failed in the mac-other job in QuestDB CI build 269255, reported in questdb/questdb#7263.

The test checks that replacing a file succeeds after a permission error. Previously, a background thread had about 80 ms to restore write permission. If that thread ran too late, the test failed even though the retry logic worked correctly.

The test now restores permission immediately after the first failed attempt, without a background thread. It checks that the operation retries exactly once, writes the expected contents, and leaves no temporary file. It also restores the original permissions even if the test fails.

Production behavior stays the same: retry limits, delays, and interrupt handling do not change. The implementation adds a private callback for the test and a null check on retries. The test still needs POSIX file permissions and skips execution as root. It does not test Windows file-sharing errors.

Validation

  • All 90 FileTokenStoreTest tests pass through Maven on macOS arm64 with Java 8 and Java 25.
  • Applying the fix to current main adds no other Java changes. The only intervening commit changes the PR-title CI check.
  • git diff --check passes.

Add a private per-call retry hook so the test restores directory write
permissions after a real denied rename on the calling thread. Assert
that exactly one retry completes the atomic replacement and consumes
the temporary file.

Remove the helper thread and its scheduling dependency on the short
retry budget. Keep production retry limits and interrupt handling
unchanged, and update the test's platform-scope comments.

Validation: all 90 FileTokenStoreTest tests pass through Maven on
macOS arm64 with Java 8 and Java 25.
@mtopolnik mtopolnik added the bug Something isn't working label Sep 11, 2026
mtopolnik added a commit to questdb/questdb that referenced this pull request Sep 11, 2026
Point the Java client submodule at e0243e31 from
fix/token-store-rename-retry, based on the client's current main.
Client PR questdb/java-questdb-client#97 carries the deterministic
FileTokenStore rename retry test fix.

This replaces the temporary origin/ent reference and includes the
intervening client PR-title CI update. The Java fix and its validation
remain unchanged.
@mtopolnik

Copy link
Copy Markdown
Contributor Author

[PR Coverage check]

😍 pass : 4 / 4 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/client/cutlass/auth/FileTokenStore.java 4 4 100.00%

@mtopolnik mtopolnik changed the title test(auth): stabilize the token-store rename retry test fix(build): stabilize the token-store rename retry test Sep 11, 2026
@mtopolnik

Copy link
Copy Markdown
Contributor Author

Review: PR #97 at e0243e31

No findings: 0 Critical, 0 Moderate, 0 Minor.

Production callers retain retry limits, interrupt handling, and cleanup behavior. The private callback adds a test seam without changing public contracts.

Coverage

  • Test gate: passes; 0 admitted coverage gaps.
  • FileTokenStoreTest: all 90 tests passed on Java 8 and Java 25, with no skips.
  • git diff --check passed.
  • No server/HA tandem required.
  • Submodule provenance: no pointer changes.

Summary

Verdict: approve.

Windows sharing-violation coverage remains outside this POSIX test’s scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working READY

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant