Repository navigation
test(worker): pin the day-long KV delivery TTL and the grace-period queue delay - #687
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…ueue delay kvDeliveryStore writes each delivery id with expirationTtl 86_400 and deferViaQueue sends the deferred message with delaySeconds rounded up from the grace period; neither value was asserted, so dropping either left the miniflare suite green (the redelivery test only reads the key back, and the grace-period test only waits for the label). The Redis store's TTL is pinned in redis.test.ts; the KV store now is too, through the expiration KV reports on list(). The delay is pinned on the fake GitHub's own clock, comparing the deferring run's config read with the resumed run's label POST under a 3 s grace period: without the delay the resume lands in under 100 ms. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Reviewed by Reviewer notesRead the tree at
Test-only change, CI green including |
|
/kind cleanup 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
Test Improvement
Two pins in
__tests__/worker/worker.test.tsforsrc/server/worker.ts, the onesrc/module neithervitest --coveragenor the Stryker sets can reach (it runs only inside workerd), so the miniflare suite is its only evidence:remembers a delivery id for a day: reads theexpirationKV reports onlist()for a handled delivery's key and bounds it to now + 86 400 s. The Redis store's TTL is already pinned inredis.test.ts:60; the KV store'sexpirationTtl: 86_400was not.holds the deferred message for the grace period: under a 3 sgrace_period_duration, asserts on the fake GitHub's own clock that the resumed run's label POST comes at least 2.5 s after the deferring run's config read. WithoutdelaySecondsthe resume lands in ~85 ms.githubSawInnow carries the ms prefix of each LOG key asat, so two entries compare on one clock; nothing else in the suite changes.Verified at
9aa12b8: withexpirationTtlanddelaySecondsremoved fromworker.tsanddist-workerrebuilt, exactly these two tests fail (expected 85 to be greater than or equal to 2500); restored, 18/18 pass, also under--sequence.shuffle.eslintandnpm run typecheckclean.Related Issue
Refs #682 — this lands the worker TTL/delay finding the hive folded into that issue as a comment; the issue's primary finding (the v8-ignore hint guard under Stryker's sandbox) remains open and is carried by #683.
Occupied-ground check: touches only
__tests__/worker/worker.test.ts; none of the held PRs #680–#686 touch__tests__/worker/.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1