Repository navigation
Description
Two tests assert on wall-clock time and failed on GitHub's shared runner on 2026-09-02 without any change to the code they measure.
EncryptDictionaryDenialOfServiceTests.HugeEncryptDictionary_opensUnderTimeout
tests/VellumPdf.Reader.Tests/EncryptDictionaryDenialOfServiceTests.cs:48, [Fact(Timeout = 10_000)], the #208/#215 regression pin. Cancelled at the timeout on two consecutive runs of the fix/kernel-encrypt-p-bit10 branch (#399), which touches neither the reader nor this test:
- run 33672982347 at
9390847:failed (canceled) (10s 129ms) - run 33675987457 attempt 1 at
eb0ce36:failed (canceled) (10s 012ms)
Attempt 2 of the second run passed with no code change, and the next push (0626bb1) passed first time. The same test takes 0.33 s in a Release build on the development machine, so the runner was at least thirty times slower for that one test. The likeliest reason is contention rather than a slow runner: the Reader assembly's classes run in parallel, and ParserFuzzTests (CsCheck, which uses every core) runs in the same assembly, so a test that allocates a 100 000-key dictionary can be starved while the fuzzer is mid-sample.
The class doc explains why the Timeout is there: pre-#215 the quadratic copy took two to three times the budget, and the timeout is what proves the fix. A time budget on a shared runner cannot prove that reliably. Options, in order of preference:
- Replace the wall-clock pin with a scaling pin: open the document at 20 000 and at 100 000 filler keys and assert the second takes less than, say, eight times the first (linear would be five, quadratic twenty-five). Both measurements suffer the same contention, so the ratio is stable where the absolute time is not.
- Keep the absolute budget but mark the class
[Collection]-isolated orDisableParallelization, so it does not share cores with the fuzzer. This still fails on a slow runner, only less often. - Raise the budget. This weakens the pin (the pre-fix cost was two to three times the budget) and still fails on a bad day.
PageTreeTests.ManyDistinctEmptyNodes_stopsAtTheKidsExaminedBudget_withNoCycleInvolved (#398, not yet merged)
Assert.True(stopwatch.Elapsed < TimeSpan.FromSeconds(30)) over a walk of 1 000 001 indirect page-tree nodes. Ran 51.8 s at 093709a and 32.9 s at 6a03b6f on the runner, passed at b6f2785. Being fixed inside #398 by building the nodes as direct dictionaries (one parse pass, no per-object resolve) and dropping the wall-clock assertion; recorded here so the two are seen as one problem.
Sweep
grep -rn "Timeout = \|Stopwatch\|TimeSpan.FromSeconds" tests/ for the remaining wall-clock assertions and apply the same reasoning to each: a time budget is only a regression pin if the pre-fix cost exceeds it on the slowest machine the suite runs on, and the shared runner has now shown that its slowest is a lot slower than the development machine.
Activity
test: widen the encrypt-dictionary pin instead of tightening its clock
Tim81 commentedon Sep 9, 2026
Adding a cause this issue does not currently name: contention between Claude sessions, not just within one assembly.
The issue attributes the flake to
ParserFuzzTeststaking every core insideVellumPdf.Reader.Tests, which is real. But on 2026-09-09 this machine was running three Claude sessions at once, one of them executing mutation passes across four worktrees — each pass a rebuild plus a full suite, one of them covering 41 mutants — while another ran full oracle suites elsewhere. The user reported the machine pegged at 100% for an extended period. Capping build and test parallelism brought it to 14%.Nobody sized a ten-second budget against that load profile, and it is invisible from inside any one session: each session's own work looks reasonable on its own.
Two measurements worth having on the record here:
This strengthens the case for option 1 in the issue body over option 3. It also argues against the intermediate design tried in #456, which compared two timings and asserted a ratio: under load the benign ratio reached 24.6 against 26.1 for the real defect, because taking the fastest of several samples drags a short measurement to its floor while a long one absorbs every preemption. #456 now raises the problem size instead, so a fixed budget separates linear from quadratic with margin on both sides.
The five remaining tests using this pattern are all in
VellumPdf.Kernel.Tests, plus one more inVellumPdf.Reader.Tests(ManyStreamsWithNoEolBeforeTheirOwnEndstream_DoesNotBecomeQuadratic) which shares a process with the fuzzer and has the same exposure. None has been seen to fail; none has had its margin measured.test: widen the encrypt-dictionary pin instead of tightening its clock
test: widen the encrypt-dictionary pin instead of tightening its clock
test: widen the encrypt-dictionary pin instead of tightening its clock
test: widen the encrypt-dictionary pin instead of tightening its clock
test: widen the encrypt-dictionary pin instead of tightening its clock
Tim81 commentedon Sep 9, 2026
A third occurrence, with its run id, since the two in the body have theirs and this one did not.
2026-09-08, run 34286930244, PR #446.
EncryptDictionaryDenialOfServiceTests.HugeEncryptDictionary_opensUnderTimeoutreportedfailed (canceled) (10s 061ms). That branch changes.github/workflows/docs-inventory.ymlandCHANGELOG.mdand no code at all, so it cannot have caused it. PR #445, which has far more in it, passed the same test in the run before.Two things found while sizing the replacement in #456, both of which change what the sweep should look at.
The six absolute
Timeoutbudgets all share a process with a CsCheck fuzzer, not just the one in the Reader assembly. Microsoft.Testing.Platform gives each test project its own process, andVellumPdf.Kernel.Testsreferences CsCheck and samples generators inPropertyTestsat the default iteration count. The five budgets there areMalformedInputTestsat three sites andPdfDictionaryIndexTestsat two.ParserFuzzTestsin the Reader assembly is the heavier of the two:FuzzBudget.DefaultIterationsis 3,000 against CsCheck's default of 100, and five more classes in that assembly sample at the same budget.The two in
PdfDictionaryIndexTestsare the highest-value target. They are the other half of this same #208 pin, they carry 140,000 keys under ten seconds, and they were sized by the same local reasoning that mispredicted the runner here. Neither has been measured on a runner.Cross-session contention is a cause the budget was never sized against. Several agent sessions share this development machine and each assumes it owns the cores. A local timing taken while another session was building is not the number a budget should be set from, in either direction.
One correction to this issue's own body: it puts the pre-fix overrun at two to three times the ten-second budget. Remeasured in #456 at 100,000 keys it is 3.4 times, from 34 s of open cost with the dictionary index disabled.
docs: rewrap the encrypt-dictionary prose that hand-editing broke
test: assert the fixture is huge, and correct what shares the fuzzer
test: stop the new assertion claiming more than it checks
test: widen the encrypt-dictionary pin instead of tightening its clock
docs: rewrap the encrypt-dictionary prose that hand-editing broke
test: assert the fixture is huge, and correct what shares the fuzzer
test: stop the new assertion claiming more than it checks
test: assert the encrypt-dictionary fixture is huge, and widen its pin (
test: replace wall-clock cost assertions with deterministic pins (#577)