Repository navigation
test(pkarr-worker): exercise RETENTION_SECONDS guard through the real DO alarm path (#10818) - #10824
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 38 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
… DO alarm path (#10818) The retention regression tests only drove worker.fetch with a mock PKARR_STORE whose putPacket re-implements the production alarm expression, so a wiring regression in the real PkarrStore would pass the suite. Add test/worker.retention.test.ts, run once per vitest project with RETENTION_SECONDS set to 0, 7d, out-of-range, and 3600: each PUT goes through SELF to the real Durable Object and asserts the scheduled alarm from real DO storage against a literal constant. The default-env matrix in worker.test.ts is untouched.
…TENTION_SECONDS via miniflare bindings Top-level projects:[] is ignored by vitest 4 (must be test.projects); without it the cloudflareTest plugin never applied. miniflare.vars is silently dropped by the plugin's V4 schema parse — the V4 shape carries plain-text vars as bindings, which merge over wrangler-derived values per key. Also keep deploy-*.test.ts in the default project so the suite still runs every file main runs.
b282d38 to
e47a0d0
Compare
Follow-up to triage task 17517.
The retention regression tests from PR #4352 only drive
worker.fetchwith a mockPKARR_STOREwhoseputPacketre-implements the production alarm expression (now + retentionMilliseconds(...)), so a wiring regression in the realPkarrStore(wrong env var, droppedsetAlarm) would pass the suite. Verified on maina20e2239: mock attest/worker.test.ts:33-48, allRETENTION_SECONDScases at:136-180via the mock, sole real-DOgetAlarmreadback at:196under default env.This PR adds
test/worker.retention.test.ts, executed once per vitest project withRETENTION_SECONDSset to0,7d, out-of-range (8640000000000), and valid non-default3600(seevitest.config.tsprojects; a DO always sees the worker's configured vars, so per-value projects are the only way to vary it). Each case PUTs throughSELFto the real Durable Object and asserts the scheduled alarm from real DO storage viarunInDurableObject+state.storage.getAlarm()against a literal constant — neverretentionMillisecondsitself. The existing default-env matrix inworker.test.tsis untouched.Test-only change; no production wiring touched.
Closes #10818.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.