Skip to content

Sanitiser cost test alternates its two input sizes, best of up to 15 runs each (#30) - #32

Merged
thebenignhacker merged 1 commit into
mainfrom
integrate/2026-10-18-r2
Oct 18, 2026
Merged

thebenignhacker merged 1 commit into
mainfrom
integrate/2026-10-18-r2

Conversation

@thebenignhacker

Copy link
Copy Markdown
Member

This pull request lands 1 commit in internal/analyzer.

Included

Verified on this exact tree

  • git ls-files --others -- '*_test.go' | wc -l: 0; git ls-files -- '*_test.go' | wc -l: 92
  • go mod verify: all modules verified
  • go build ./...: exit 0
  • go vet ./...: exit 0
  • gofmt -s -l . | wc -l: 0
  • go test -race -p 4 -count=1 -json -skip '^TestAZoneScopedLinkLocalTargetIsScanned$' ./...: exit 0; result events counted from its output: packages passed 6, failed 0, skipped 0; top-level tests passed 401, failed 0, skipped 1; subtests passed 527, failed 0, skipped 0
  • the 1 skipped top-level test: TestFIPSChildScanNamesTheHybridGroupsItCannotOffer, skip message "runs in the child process that TestAFIPSBuildWithoutMLKEMNamesTheHybridGroupsItCannotOffer starts"
  • not run: TestAZoneScopedLinkLocalTargetIsScanned in internal/scanner (the -skip above), whose helper listenOnALinkLocalAddress binds a link-local IPv6 address, not 127.0.0.1 or ::1
  • golangci-lint run --timeout=5m --concurrency=4 ./...: exit 1, 17 issues (errcheck: 10, staticcheck: 6, unused: 1); the same command on origin/main (aa54432) printed the same 17 finding lines (diff of the sorted lines printed nothing)

Not included

None

Closes

Fixes #30

How to merge

Rebase and merge, so that each change stays its own commit on main.

…runs each (#30)

TestSanitizeForReportCostDoesNotGrowQuadratically timed three runs of the
50 KB input and then three runs of the 200 KB input, so load that arrived
between the two batches landed on the larger size alone. With 24 copies of
the test running at once under -race on a 16-core machine, it failed 6 of
360 runs and then 7 of 360, with ratios including 10.4x, 16.8x and 34.9x,
against code that is linear.

The sizes now take turns, one run of each per round for up to 15 rounds, and
the fastest run of each is compared against the same 8x bound. After the
third round no further round starts once the observed time passes 2 seconds,
so an implementation as slow as the pre-fix one is timed three times per
size, as before. The same 24-copy load ran the changed test 720 times with
no failure.

A fake-clock test covers the failure: with load arriving once three small
runs are done, the old order reports 1ms and 12ms and the new order reports
1ms and 4ms. A second test checks that the budget stops the rounds.

Fixes #30
@thebenignhacker
thebenignhacker merged commit cc82fc4 into main Oct 18, 2026
2 checks passed
@thebenignhacker
thebenignhacker deleted the integrate/2026-10-18-r2 branch October 18, 2026 04:01
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.

TestSanitizeForReportCostDoesNotGrowQuadratically fails under a parallel race run of the suite

1 participant