Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky ThreadedPoolTest.mustNotHoldOnToDeallocatedObjectsWhenLeakDetectionIsEnabled #161

Merged
merged 2 commits into from
May 27, 2024

Conversation

chrisvest
Copy link
Owner

When background expiration checking was enabled, it was possible for the test to race with the background expiration check. This could cause slots to end up in the disregardPile or live queue, instead of the thread-local slot as intended. The disregardPile or live queue would then maintain a strong reference to the object that we were hoping would be deallocated and all references purged, besides the weak reference in the test. The fix is to disable background expiration checking in this test.

…etectionIsEnabled

When background expiration checking was enabled, it was possible for the test to race with the background expiration check.
This could cause slots to end up in the disregardPile or live queue, instead of the thread-local slot as intended.
The disregardPile or live queue would then maintain a strong reference to the object that we were hoping would be deallocated and all references purged, besides the weak reference in the test.
The fix is to disable background expiration checking in this test.
It seems to be a common theme that background expiration checking can interfere with tests that expect to be able to TLR claim objects deterministically.
@chrisvest chrisvest merged commit b59011d into main May 27, 2024
3 checks passed
@chrisvest chrisvest deleted the fix-flaky-test branch May 27, 2024 22:19
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.

None yet

1 participant