Skip to content

Let the Rust descriptor test wait for exiting threads - #25

Merged
jbwinters merged 3 commits into
mainfrom
task/rust-descriptor-settle
Oct 27, 2026
Merged

jbwinters merged 3 commits into
mainfrom
task/rust-descriptor-settle

Conversation

@jbwinters

Copy link
Copy Markdown
Collaborator

rust/tests/descriptors.rs counted /proc/self/fd and /proc/self/task immediately after each invocation. A joined thread can stay listed in /proc/self/task for a moment after it exits, so the exact count intermittently saw one extra thread ("threads grew from 2 to 3"). This failed CI on main after the Rust SDK merge, and twice on another branch.

The test now polls for up to two seconds until each count returns to its baseline. A leak persists, so it still fails: with a deliberately leaked thread added, the test fails with "threads grew from 2 to 3". Without it, the test passed 20 of 20 local runs, and clippy and rustfmt are clean. Test-only change.

A joined thread can stay listed in /proc/self/task briefly after it exits,
so an exact count taken at once intermittently saw one extra thread (main
CI failed this way after the Rust SDK merge). Poll for up to two seconds
for the counts to return to the baseline; a real leak still fails.
@jbwinters
jbwinters merged commit a9858da into main Oct 27, 2026
10 checks passed
@jbwinters
jbwinters deleted the task/rust-descriptor-settle branch October 27, 2026 22:24
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