Skip to content

Stabilise Queue test cleanup and normalise documentation markers#1700

Open
peter-lawrey wants to merge 7 commits into
developfrom
adv/scqindexing
Open

Stabilise Queue test cleanup and normalise documentation markers#1700
peter-lawrey wants to merge 7 commits into
developfrom
adv/scqindexing

Conversation

@peter-lawrey

@peter-lawrey peter-lawrey commented Mar 10, 2026

Copy link
Copy Markdown
Member

This PR improves Chronicle Queue test stability by centralising background resource cleanup and making queue directory deletion more reliable, especially around mapped file handles and Windows cleanup behaviour.

It also tidies the documentation by replacing non-ASCII punctuation and star-based Enterprise markers with clearer plain-text wording.

Changes

  • Add shared QueueTestCommon.drainBackgroundCleanup() helper to:

    • release pending background resources;
    • wait for a GC cycle where supported;
    • release pending background resources again.
  • Add QueueTestCommon.deleteDirAfterCleanup(...) for safer test directory deletion after mapped-file cleanup.

  • Replace repeated direct calls to BackgroundResourceReleaser.releasePendingResources() across tests with the shared cleanup helper.

  • Make tests more robust when deleting queue files or directories after appender/tailer activity.

  • Improve AppenderFileHandleLeakTest by:

    • using named timeout/retry constants;
    • closing tailers with try-with-resources;
    • draining cleanup before checking mapped files;
    • shutting down the executor in preAfter().
  • Add a TableStoreWriteLockTest case to verify a subprocess can acquire the table-store write lock before timeout.

  • Update tests that now need expected-exception handling to extend QueueTestCommon.

  • Avoid resetting the security manager on Java 17+.

  • Normalise documentation and examples by:

    • replacing smart quotes with ASCII quotes;
    • replacing Enterprise markers with (Enterprise);
    • replacing raw binary .cq4 sample output with [binary cq4 bytes omitted];
    • simplifying Javadoc punctuation to avoid non-ASCII characters.

Risk

Low. The production code changes are limited to documentation/Javadoc wording. The behavioural changes are test-side cleanup and stability improvements.

@peter-lawrey peter-lawrey requested review from sam-ross and tgd March 10, 2026 10:12
@peter-lawrey peter-lawrey changed the title Adv/scqindexing fix: harden SCQIndexing seek logic and de-flake queue cleanup tests Mar 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

@tgd tgd removed their request for review May 5, 2026 07:34
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

@peter-lawrey peter-lawrey changed the title fix: harden SCQIndexing seek logic and de-flake queue cleanup tests Stabilise Queue test cleanup and normalise documentation markers Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants