Skip to content

Comments

Flaky tests#267

Merged
chrisvest merged 9 commits intomainfrom
flaky-tests
Feb 18, 2026
Merged

Flaky tests#267
chrisvest merged 9 commits intomainfrom
flaky-tests

Conversation

@chrisvest
Copy link
Owner

Another round of fixing various flaky tests and real bugs.

After starting the shut down process, there's a slight chance that an allocation could race and insert a slot in `newAllocations`.
The `shutdownCompletion` never refilled the `newAllocations`, so such slots would never show up in the `live` queue.
This could in turn cause the shut down process to stall forever.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses flaky tests and real bugs in Stormpot by improving test infrastructure and fixing timing-related issues in the allocation controller.

Changes:

  • Refactored test thread management from static methods to ExecutorExtension for better test isolation
  • Fixed allocation failure timeout calculation in BAllocThread (changed from linear to 50ms increments per failure)
  • Fixed shutdown completion in InlineAllocationController to properly refill newAllocations pile
  • Disabled background thread test for InlinePoolIT (which has no background thread)
  • Updated Maven wrapper from 3.9.6 to 3.9.12
  • Fixed assertEquals parameter order to follow codebase convention

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/test/java/testkits/UnitKit.java Removed static executor and fork methods, moved to ExecutorExtension
src/test/java/testkits/GarbageCreator.java Updated to accept ExecutorExtension parameter
src/test/java/stormpot/tests/extensions/ExecutorExtension.java Added fork, forkFuture, and exception handling classes moved from UnitKit
src/test/java/stormpot/tests/blackbox/slow/PoolIT.java Fixed flaky test by changing timing measurement approach
src/test/java/stormpot/tests/blackbox/slow/InlinePoolIT.java Disabled background thread test (not applicable)
src/test/java/stormpot/tests/blackbox/ThreadBasedPoolTest.java Updated to use executor.forkFuture instead of static method
src/test/java/stormpot/tests/blackbox/AllocatorBasedPoolTest.java Updated to use executor instance methods and fixed assertEquals order
src/test/java/stormpot/tests/blackbox/AbstractPoolTest.java Added ExecutorExtension field and updated all fork/forkFuture calls
src/test/java/stormpot/tests/StackCompletionTest.java Added ExecutorExtension field and updated all fork/forkFuture calls
src/test/java/stormpot/tests/PreciseLeakDetectorTest.java Added ExecutorExtension field and updated GarbageCreator calls
src/test/java/stormpot/tests/PreciseLeakDetectorIT.java Added ExecutorExtension field and updated GarbageCreator calls
src/main/java/stormpot/internal/InlineAllocationController.java Fixed bug: added newAllocations.refill() in shutdown completion
src/main/java/stormpot/internal/BAllocThread.java Fixed bug: changed allocation failure backoff from 1ms to 50ms per failure, added @SuppressWarnings for unchecked casts
.mvn/wrapper/maven-wrapper.properties Updated Maven version from 3.9.6 to 3.9.12 with correct SHA256

@chrisvest chrisvest merged commit a0a2b20 into main Feb 18, 2026
19 checks passed
@chrisvest chrisvest deleted the flaky-tests branch February 18, 2026 15:04
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.

1 participant