fix(test): increase awaitTermination timeout in concurrency test#16367
Closed
circleci-app[bot] wants to merge 2 commits intoapim-13586from
Closed
fix(test): increase awaitTermination timeout in concurrency test#16367circleci-app[bot] wants to merge 2 commits intoapim-13586from
circleci-app[bot] wants to merge 2 commits intoapim-13586from
Conversation
**Root cause:** The concurrency test `shouldNotThrowConcurrentModificationException_concurrentReadersAndWriters` uses `awaitTermination(durationMs + 5000, MILLISECONDS)` (8000ms total) to wait for reader/writer threads to finish. On slow CI machines, the writer thread's per-iteration cost is higher than expected — each iteration calls `Mockito.when()`, `createReactorHandler()`, `reactorHandlerRegistry.create()`, and `reactorHandlerRegistry.remove()`, all of which have non-trivial overhead. The test elapsed 11.03s, meaning the writer was still running ~8s after `awaitTermination` was called, exceeding the timeout. **Fix approach:** Increase the `awaitTermination` timeout from `durationMs + 5000` (8000ms) to `durationMs + 15000` (18000ms) for both the readers and writer executor services. This gives the threads sufficient time to complete their current iteration on slower CI infrastructure without changing the test semantics. **Changes made:** - `ReactorHandlerRegistryTest.java`: Changed `awaitTermination` timeout from `durationMs + 5000` to `durationMs + 15000` for both `readers` and `writer` executor services
13cc40e to
8126d57
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prompt Given
Fix job failure for job 1632591
Root cause: The concurrency test
shouldNotThrowConcurrentModificationException_concurrentReadersAndWritersusesawaitTermination(durationMs + 5000, MILLISECONDS)(8000ms total) to wait for reader/writer threads to finish. On slow CI machines, the writer thread's per-iteration cost is higher than expected — each iteration callsMockito.when(),createReactorHandler(),reactorHandlerRegistry.create(), andreactorHandlerRegistry.remove(), all of which have non-trivial overhead. The test elapsed 11.03s, meaning the writer was still running ~8s afterawaitTerminationwas called, exceeding the timeout.Fix approach: Increase the
awaitTerminationtimeout fromdurationMs + 5000(8000ms) todurationMs + 15000(18000ms) for both the readers and writer executor services. This gives the threads sufficient time to complete their current iteration on slower CI infrastructure without changing the test semantics.Changes made:
ReactorHandlerRegistryTest.java: ChangedawaitTerminationtimeout fromdurationMs + 5000todurationMs + 15000for bothreadersandwriterexecutor servicesView more about this proposed fix in the CircleCI web app →