Skip to content

Deflake TestRoutePatterns410 second boundary - #484

Merged
dborup merged 1 commit into
masterfrom
test/483-route-patterns-410-flake
Oct 15, 2026
Merged

dborup merged 1 commit into
masterfrom
test/483-route-patterns-410-flake

Conversation

@dborup

@dborup dborup commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Relates to #483

Problem

TestRoutePatterns410_HiddenHopWithTrafficLooksUnknown seeded its fixture from separate time.Now() calls (seedRoutePatternsDB, rpAddTraffic, rpInsertObserver, ...). When two calls straddled a second boundary, the hidden and unknown detail responses differed only in firstSeen/lastSeen, so the byte-identical comparison failed.

Plan / change

  • Test-only change in cmd/server/subpaths_visibility_410_test.go.
  • One package-level rpRefTime (truncated to the second) is the single reference time for every seed helper.
  • The indistinguishability comparison is untouched: no normalization, no retries.
  • New regression test TestRoutePatterns410_SeedsShareOneClock seeds, waits across a second boundary, adds traffic, and asserts one distinct first_seen.

Verification

  • Regression test: red before the fix (2 distinct values), green after.
  • go test -run TestRoutePatterns410 -count=50 ./cmd/server passes.
  • Privacy mutant (detail handler answers with an unfiltered visibility map) fails the hidden-vs-unknown tests; reverted afterwards.
  • go test ./... in cmd/server and cmd/ingestor, sh test-all.sh, node test-frontend-helpers.js pass.
  • No frontend or server code changed, so no E2E or browser run applies.

Config/customizer: none. No perf impact (test code only).

🤖 Generated with Claude Code

Seed helpers read time.Now() separately, so the hidden and unknown rows
could get firstSeen values a second apart. All seeds now derive from one
rpRefTime; adds a regression test that crosses a second boundary.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dborup

dborup commented Oct 15, 2026

Copy link
Copy Markdown
Owner Author

Rapport — CS-Minimax PR#484 #483 — head 36ae179

Status: Draft PR open; all CI jobs green, no re-runs needed; ready for human review.

Requirement: deterministic test, privacy check not weakened

Item Evidence
Regression test TestRoutePatterns410_SeedsShareOneClock (seeds, crosses a second boundary, adds traffic, expects 1 distinct first_seen) [T] red before the fix (2 distinct values), green after
go test -run TestRoutePatterns410 -count=50 ./cmd/server [T] passes (50 runs)
Privacy mutant: detail handler answers with an unfiltered visibility map [T] hidden-vs-unknown tests fail (HiddenHopWithTrafficLooksUnknown, DetailHidden*); reverted, working tree clean
Comparison unchanged: no normalization, no retries [A] diff only replaces time.Now() calls with one rpRefTime

Other checks

Check Result
go test ./... in cmd/server and cmd/ingestor [T] pass
sh test-all.sh, node test-frontend-helpers.js [T] pass
scripts/check-xss-sinks.sh --diff origin/master [T] clean (no public/ changes)
No new map[string]interface{}, no colors, cmd/server read-only [A] test-only diff, one file
Fork-guards in deploy.yml / release-fast-path.yml [A] no workflow files touched; counts not re-measured
Browser/E2E validation [K] not applicable locally (test-only change); CI Playwright shards pass

CI per job

All pass: Go Build & Test, Go Ingestor Tests, Go Libraries & CLI, Go Server Tests 1/3, 2/3, 3/3, JavaScript Unit Tests & Lint, Script & Container Unit Checks, Playwright E2E 1/3, 2/3, 3/3, Validate Docker Image, Verify E2E Shards & Coverage, Verify Go Test Assignments, Build & Publish Docker Image. Skipped (by design): Publish Badges & Summary, Release Artifacts, Deploy Staging. Known-flaky #271 did not fail.

Remaining

  • Config/customizer: none.
  • Draft left as is; not merged, not marked ready.

@dborup
dborup marked this pull request as ready for review October 15, 2026 22:51
@dborup
dborup merged commit 8f01d37 into master Oct 15, 2026
18 checks passed
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