Repository navigation
docs(testing): D-19 says what the nextest LEAK was, and that it is not the slugify test's defect - #182
Merged
Conversation
…t the slugify test's defect #166's message reports `parity_slugify_of_drawn_names_is_the_pins` as "leaky" once in a full run. The test is pure: an `include_str!` fixture parsed per test, no thread, no process, no static, no shared path, so nothing in it can leak. nextest's `LEAK` (0.9.140, `leak-timeout` 200 ms by default since 0.9.108) is a pass whose stdout or stderr pipe is still open that long after the process exited, and a leak passes unless the profile asks for `result = "fail"`. Reproduced on 2026-11-15 on the Mac that saw it: 1 of 30 full `--profile ci --workspace` runs (20 plain, 10 with 18 busy loops on 18 cores) flagged one test, and it was `thrust-core::change_password ...::sign_ins_first_1_true` at 0.211 s, not a slugify test; 20 runs of `-p thrust-api-v1` alone under the same load flagged none (128,560 test runs, 1 leak). That test has one thread and spawns nothing, so another process held its pipe. CI's `hermetic` logs (Linux) hold no LEAK in 49 runs, which does not tell the platforms apart (about 1.4 expected at the Mac's rate; none has a probability near 1 in 4). The mechanism reproduces without any test of ours (`tools/fd-race`, std only): 16 threads spawn children with piped stdout, one in eight living 400 ms; on macOS 5 of 62,976 short children (3 runs) had their stdout held 100 ms or more after exiting, 406 to 408 ms at worst, the holder's lifetime; on Linux 0 of 41,984 (2 runs). On macOS std makes a pipe with `pipe()` then `fcntl(FD_CLOEXEC)`, and a child another thread spawns between the two keeps the write end across `exec`; Linux has `pipe2(O_CLOEXEC)`. What is not shown: that nextest's own spawn is what does it in a run (no `lsof` while a leak happened). As the owner chose for the case where the slugify leak is not found: no change to a test and none to `.config/nextest.toml` (a leak is a pass; `result = "fail"` would turn about 1 test run in 128,000 of an OS race into a red build; a longer `leak-timeout` is rule 3's timeout raised to get green). D-19 records it, so a LEAK on a Mac is read as noise about the run and one in CI as a finding. Refs: #58 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 15, 2026
… into the OpenAPI Projects branch #179 conflicted with main a third time, once the three small PRs it was opened with had merged. One conflict, `docs/src/testing/status.md`, and it is one hunk because G-25 and G-26 are adjacent rows: this branch changed G-25 only (the schema diff), #180 changed G-26 only (`THRUST_RL_CREATE_ID`). Checked by hash against the merge base (G-25 4337a2f968e5 on main and the base, 55eb907971f4 here; G-26 bb75219068af on the base and here, 104945eb6fb9 on main), so the resolution is this branch's G-25 row and main's G-26 row, and each now has exactly those hashes. `.github/workflows/ci.yml` merged without a conflict: `deps` has the count guard's self-test, the release step and the OpenAPI step; `hermetic` has the count check and the OpenAPI tests; `lint` has the OpenAPI clippy. #182's D-19 row and #181's sentence in G-33 are in `status.md`, no conflict marker is left anywhere in the tree, and `cargo metadata --locked` resolves. Refs: #58 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #58; this PR does not close it.
#166's commit message reports that
thrust-api-v1'sparity_slugify_of_drawn_names_is_the_pinswas "leaky" once in the full parallel run. This is the result of looking for that, and it changes the question: the slugify test is not what leaks, and nothing in Thrust's code is. There is nothing to fix in a test or in the nextest config, so this adds the record (D-19) and the measurement it rests on.What a LEAK is
nextest 0.9.140's
LEAKis a pass whose stdout or stderr pipe is still open 200 ms after its process exited (the defaultleak-timeoutsince 0.9.108; the docs still say 100 ms in places). A leak is a pass unless the profile saysleak-timeout = { period = ..., result = "fail" }, which shows asLEAK-FAIL. (Leaky tests, changelog.)What I found
include_str!fixture and parses it per test: no thread, no process, no static, no shared path, no proptest file.ciprofile, no retries): 1 of 30 full runs (20 plain, 10 with 18 busy loops on 18 cores) flagged one test,thrust-core::change_password the_old_password_shares_the_sign_in_allowance_and_is_counted_before_any_hashing::sign_ins_first_1_true, at 0.211 s (the 200 ms plus its own 11 ms). No run flagged a slugify test, and 20 runs of-p thrust-api-v1alone under the same load flagged none. That is 128,560 test runs and one leak.argon2is built without its parallel feature), so another process held its pipe.hermeticlogs of the 49 runs onmainwhere it ran (178,194PASSlines) hold noLEAK. At the Mac's rate about 1.4 would be expected, so none has a probability of about 1 in 4.The mechanism, reproduced without any test of ours
tools/fd-race(std only, its own workspace): 16 threads spawn children with piped stdout, one in eight living 400 ms, the others exiting at once, and it times how long a short child's stdout takes to reach EOF after it exited.rust:1)Each delay is the lifetime of the holder. On macOS std makes a pipe with
pipe()and thenfcntl(FD_CLOEXEC), two steps; a child another thread spawns between them keeps the write end acrossexec. Linux haspipe2(O_CLOEXEC).Not shown: that nextest's own spawn is what does this in a run. Nobody ran
lsofwhile a leak was happening, and the rate of one in about 128,000 makes that a long wait.What changes
docs/src/testing/status.md: D-19, with the numbers above and what each does and does not show.tools/fd-race/: the program, its README andresults/2026-11-15.txt(every run, as printed). It builds with--locked.No test and no
.config/nextest.tomlchange, as you chose for the case where the slugify leak is not found (a leak is a pass;result = "fail"would turn about one test run in 128,000 of an OS race into a red build; a longerleak-timeoutis AGENTS.md rule 3's timeout raised to get green). The reading is: aLEAKon a Mac is noise about the run, and one in CI, where the race should not exist, would be a finding.The two scripts that did the 50 runs and read the 49 CI logs are in my session's scratchpad, not committed (D-19 says so).
🤖 Generated with Claude Code