Repository navigation
test(project-data): ticket-lifetime test bounds from the clock, not an assumed 2 s - #494
Merged
Merged
Conversation
…n assumed 2 s test_the_ticket_lives_no_longer_than_the_export set the export to expire in 30 s and required the ticket's lifetime to be 28 to 30 s. On a loaded CI runner (main bc71694, Backend - Test & Lint) minting took over 3 s, the ticket correctly got 26 s, and the test failed. The lower bound is now the whole seconds left on the export read just after minting, which brackets the product's min(60, seconds left) exactly at any runner speed. Mutation-checked: a ticket ignoring the export's expiry (60 s) and one 5 s short both fail; a simulated 3.5 s slow mint passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Anand Topu <anand.goud.2020@gmail.com>
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.
Summary
Backend — Test & Lintfailed on main atbc71694c(run 45937142204) on one test of 25,524:tests/test_project_data_download.py::test_the_ticket_lives_no_longer_than_the_export.The test sets an export to expire in 30 s and required the download ticket's lifetime to be 28 to 30 s, assuming minting takes under 2 s. On a loaded runner it took over 3 s; the ticket correctly got 26 s (
min(60, whole seconds left)) and the test failed:The product is right. The test now reads its lower bound from the clock just after minting, which brackets the product's formula at any runner speed. The upper bound (30 s, under the 60 s cap) is unchanged. The next main run (
955292f0) passed, which confirms it is timing.Verification
tests/test_project_data_download.py: 59 passed.Checklist
SKIP_PUSH_CHECK=1at the owner's request (the local gate failed twice this week on unrelated timing tests under machine load); CI runs the full suite🤖 Generated with Claude Code