Fix the stale-read flake in TestRunnerAuthz_ReadonlyAllow - #14
Merged
Merged
Conversation
The test wrote a relationship and immediately checked it through a cacheless Checker. With no ZedToken cache there is no freshness floor, so CheckToolCall runs the check at MinimizeLatency — which is free to serve a quantized snapshot predating the write this same test just made (the consistency notes in CheckToolCall spell this out). The just-granted reader is then invisible and the expected allow comes back as a deny. This is not hypothetical: the test failed 5 of 30 local runs and took down two consecutive CI integration jobs (this branch's base and PR one of its descendants) with the identical denial message. The deny sibling never flakes because a stale read still denies, and the ZedTokenFreshness sibling already floors its check. Seed a ZedTokenCache with the WriteRelationships response token so the check runs AtLeastAsFresh at the write's revision — the same pattern TestRunnerAuthz_ZedTokenFreshness uses. What this test claims is the readonly allow path, not floorless freshness. 60 of 60 local runs pass with the floor in place.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
|
The e2e failure on the first CI run here was |
This branch was successfully deployed
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.
The flake
TestRunnerAuthz_ReadonlyAllowwritesgithub_repo:foo#reader@user:aliceand immediately checksreadthrough a cachelessChecker. With no ZedToken cache there is no freshness floor, soCheckToolCallruns the check atMinimizeLatency— which may legally serve a quantized snapshot predating the write the test just made (the consistency notes incheck_tool_call.godescribe exactly this shape). The just-granted reader is then invisible and the expected allow comes back as:Measured locally at 5/30 and 1/30 failing runs; it failed two consecutive CI integration jobs (main at 92f61c4, then PR #12) with the identical message. The deny sibling never flakes because a stale read still denies;
TestRunnerAuthz_ZedTokenFreshnessalready floors its check.The fix
Seed a
ZedTokenCachewith theWriteRelationshipsresponse token so the check runsAtLeastAsFreshat the write's revision — the same patternTestRunnerAuthz_ZedTokenFreshnessuses, and what production callers do. What this test claims is the readonly allow path, not floorless freshness, so the floor narrows nothing the test was asserting.Verification
go test -tags=integration -count=60 -run '^TestRunnerAuthz_ReadonlyAllow$' ./pkg/authz/spicedb/toolcheck/— 60/60 pass (pre-fix: 5/30 failing).