test(cache): cover a late 304 and widen the stale margin - #20
Merged
Merged
Conversation
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.
Tests only. A new test covers the case where a background revalidation gets a 304 after a
no-cacherequest has stored a newer response. The newer entry must stay. The stale-while-revalidate test now has a wider timing margin, so a loaded CI runner cannot flake it.Changes
late_not_modified_leaves_a_newer_entry_in_placedelays the 304 by 2 s and waits on origin requests and therevalidationscounter, not on sleeps.stale_while_revalidate_serves_stale_and_refreshes_in_the_backgrounduses a 3 s origin delay and a 1 s bound. The old values were 500 ms and 400 ms.Verification
Arc::ptr_eqcheck inStore::freshenremoved, the new test fails: the next hit carries the old"v1"ETag.while_revalidatingforced to revalidate before it answers, the stale test fails its elapsed-time assertion.