Skip to content

Add production durability check#5

Merged
avikalpg merged 2 commits into
masterfrom
nia/add-durability-regression-test
Jun 5, 2026
Merged

Add production durability check#5
avikalpg merged 2 commits into
masterfrom
nia/add-durability-regression-test

Conversation

@avikalpg

@avikalpg avikalpg commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace the implementation-coupled isolate-loss unit test with a production durability canary
  • add npm run test:production-durability, which hits the public HTTP API with a unique key, waits past the flush window, then verifies readOnly=true still sees the increment

Why

The durability failure depends on real Cloudflare runtime behavior, not just application code. CI unit tests should stay user-behavior focused and deterministic; this check is intentionally run against a deployed endpoint.

Test

  • npm test passes
  • COUNTER_BASE_URL= npm run test:production-durability prints usage and exits 2 as expected

Replace the implementation-coupled isolate-loss unit test with a public HTTP canary that validates user-visible counter durability after the flush window. Keep CI unit tests focused on local API behavior.
@avikalpg avikalpg force-pushed the nia/add-durability-regression-test branch from 92780ac to 556ecbe Compare May 31, 2026 12:42
@avikalpg avikalpg changed the title Add regression test for non-durable counter increments Add production durability check May 31, 2026
Add two steps after wrangler deploy:
- 10s propagation wait (Workers global network, not just one edge node)
- npm run test:production-durability against counter.avikalp.workers.dev

Canary increments a unique key, waits 130s (10s past the 2-min KV flush
window), then verifies readOnly still sees the increment. Failure fails
the deployment job so we know production may be losing increments.
@avikalpg avikalpg merged commit 5c2518f into master Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant