Skip to content

Add a timeout to the barrier in the test_isal_compress_decompress_threaded test - #292

Open
ptweezy wants to merge 1 commit into
pycompression:developfrom
ptweezy:test-barrier-timeout
Open

ptweezy wants to merge 1 commit into
pycompression:developfrom
ptweezy:test-barrier-timeout

Conversation

@ptweezy

@ptweezy ptweezy commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

A job in test_isal_compress_decompress_threaded that fails makes fewer barrier.wait() calls than the other jobs. When the jobs run out, the remaining threads wait at the barrier for a thread that has no job left, so the test never finishes and never reports the AssertionError. I checked this by making one decompress() call return wrong data.

The test now creates its own barrier with a 10 s timeout. A module-level barrier would stay broken and also fail the next parameter set. With the same wrong data, the test fails with the AssertionError after about 10 s. Under ThreadSanitizer with free-threaded CPython 3.14.8t, the longest wait at the barrier was 71 ms with 4 CPUs, 0.3 s with 1 CPU, and 0.7 s with a quarter of a CPU.

This PR changes only tests, so it has no CHANGELOG entry.

Checklist

  • Pull request details were added to CHANGELOG.rst
  • Documentation was updated (if needed)

A failed job made fewer barrier waits than the other jobs, so when the
jobs ran out, the other threads waited at the barrier forever and the
test never finished. Create the barrier in the test function with a
10 s timeout, because a module-level barrier would stay broken and
also fail the next parameter set.
@ptweezy
ptweezy force-pushed the test-barrier-timeout branch from 4790836 to f3b243e Compare October 24, 2026 17:05

This branch has not been deployed

No deployments
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