Skip to content

tests: Fix a race in test_tracking.py - #1106

Merged
godlygeek merged 1 commit into
bloomberg:mainfrom
godlygeek:fix_race_in_tests
Nov 25, 2026
Merged

godlygeek merged 1 commit into
bloomberg:mainfrom
godlygeek:fix_race_in_tests

Conversation

@godlygeek

Copy link
Copy Markdown
Contributor

In test_thread_allocations_multiple_threads, it was possible for one thread to make its allocation and exit before the second thread makes its allocation. When a thread dies it frees its pthread state, which can be quite large, which might mean that by the time the second thread allocates its allocation will no longer be part of the high water mark.

Prevent this by ensuring that neither thread can exit until both threads have made their allocation.

@godlygeek godlygeek self-assigned this Nov 25, 2026
Comment thread tests/integration/test_tracking.py Resolved
In `test_thread_allocations_multiple_threads`, it was possible for one
thread to make its allocation and exit before the second thread makes
its allocation. When a thread dies it frees its pthread state, which can
be quite large, which might mean that by the time the second thread
allocates its allocation will no longer be part of the high water mark.

Prevent this by ensuring that neither thread can exit until both threads
have made their allocation.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
@godlygeek
godlygeek enabled auto-merge (rebase) November 25, 2026 19:17
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.38%. Comparing base (4e4dd93) to head (90e56a6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1106      +/-   ##
==========================================
- Coverage   92.40%   92.38%   -0.02%     
==========================================
  Files         103      103              
  Lines       13453    13467      +14     
  Branches      480      480              
==========================================
+ Hits        12431    12442      +11     
- Misses       1022     1025       +3     
Flag Coverage Δ
cpp 92.38% <100.00%> (-0.02%) ⬇️
python_and_cython 92.38% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@godlygeek
godlygeek merged commit 97ee14c into bloomberg:main Nov 25, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants