Fix the listener single-flight race; make the certificate metrics test deterministic #86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "deterministic-test-budgets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two flaky tests, one of them a real (benign) listener race.
lib/salt_dns/listener/guard.ex,miss/4). A handler that missed the cache could claim the key just after another handler had stored the answer and released its claim, then ask the database again. "One name repeated costs one lookup" therefore did not always hold (review_fixes_test.exs:158 got 4 queries instead of 2 under CI load). The budget and gate always applied. Fix: the claim reads the cache once more and returns a fresh hit; the flight marker is deleted on every exit (try/after, a raising lookup included).miss/4is now public with@doc falseso a test can enter at the claim; no sleep or hook in lib. Tests in guard_test.exs: a late claim does not ask again, a fresh claim looks up and releases, a raising lookup releases. Shown: a temporary random sleep before the claim made the F3 test fail 5/5 (42-52 queries); with the fix and the same sleep it passes 5/5; the file passed 30/30.metrics-caorder the old file failed and the new one passes; 30/30 alone.CHANGELOG entry added.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DnYzaTxC2GmdSpvCNyHNne
Make the certificate metrics test independent of the shared reporterto Fix the listener single-flight race; make the certificate metrics test deterministic