Skip to content

The dial cancellation test cannot hang on a slow runner - #115

Merged
sepehr-safari merged 1 commit into
mainfrom
the-cancel-test-cannot-hang
Sep 23, 2026
Merged

sepehr-safari merged 1 commit into
mainfrom
the-cancel-test-cannot-hang

Conversation

@sepehr-safari

Copy link
Copy Markdown
Contributor

Closes #114.

The cancellation test added in 0.14.4 dialled with std.testing.allocator, which captures a stack trace on every allocation. On macOS that capture takes a lock which notices a pending cancel and swallows it, so a dial cancelled while still allocating would never return and the test would hang rather than fail. It passes today only because the dial is normally past its allocations by the time the cancel lands at 100 ms.

It now dials with a DebugAllocator that still checks for leaks but captures no stack traces. With one of dial's frees removed, the test still fails and names the leak.

Test only; nothing in the library changes. All 211 tests pass.

…w the cancel

std.testing.allocator captures a stack trace on every allocation, and on macOS that takes a lock which swallows a pending cancel. A dial cancelled while still allocating would then never return, and the test would hang instead of failing. It now uses a leak-checking DebugAllocator with no stack traces. Dropping one of dial's frees still fails it, with the leak named.

Closes #114.
@sepehr-safari
sepehr-safari merged commit 4642ad1 into main Sep 23, 2026
2 checks passed
@sepehr-safari
sepehr-safari deleted the the-cancel-test-cannot-hang branch September 23, 2026 10:07
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.

The dial cancellation test can hang on macOS instead of failing

1 participant