Repository navigation
test(ci): conditional head scan and jittered watch passes (P7-AUTO-11) - #548
Merged
Merged
Conversation
TestScanHeadsConditional: after a full scan, an unchanged repository costs two (three with extra branches) conditional 304 requests and nothing more; a new pull request is read in full. TestConditionalRequests: a 304 scan keeps the previous heads, and two hosts poll at distinct offsets with a wait inside [0.9, 1.1) of the interval. fix(ci): ScanHeads returned Calls as 0 on every path because the deferred count wrote a local copy; the result is now named.
Contributor
Author
|
Folded into #543 (land/p7f-plugins) to land in one CI run. |
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.
P7-AUTO-11's conditional-request acceptance had no proof in #543.
TestConditionalRequestsis named in its verify line, andScanHeadshad no test at all. Stacked on #543 (baseland/p7f-plugins).internal/providers/github/reconcile/scan_conditional_test.go,TestScanHeadsConditional: on the HOST-17 fixture forge, after a full scan an unchanged repository answers 304 on the repo and pull list (plus the branch list when extra branches are configured).ScanHeadsthen makes no further request: 2 or 3 conditional requests, zero non-304. A new pull request is read in full and its head reported.internal/watch/conditional_test.go,TestConditionalRequests: a 304 scan keeps the previous heads and reruns nothing. A 304 before any full scan acts on nothing. Two hosts get distinct phase offsets, and their waits fall in [0.9, 1.1) of the interval. The quota stop is already covered byTestQuotaStopsPass.Bug fixed
Engine.ScanHeadsdocumentsHeadScan.Calls("requests made, 304s included"), but it always returned 0. The deferredres.Calls = s.usedwrote a local copy afterreturn res, ...had already copied it. The results are now named. Nothing readsCallsyet, so behaviour is otherwise unchanged.Verification (local, scoped)
go test -mod=vendor -count=1 ./internal/providers/github/reconcile/ ./internal/watch/: ok, ok (full packages).Not covered here
cmd/serve_watch_test.gois still absent. Its behaviours are proven ininternal/watch.Ticket: P7-AUTO-11