Repository navigation
[wrangler] Reuse a shared KV namespace in remote-bindings E2E tests - #16910
Conversation
Setup created a fresh KV namespace on every run and wrote a test key to it. Brand-new namespaces sometimes reject writes with "namespace not found" for longer than setup waited, which fails the whole suite. That is the most common failure of this step in recent Wrangler E2E runs, on every OS. Look up a shared `preserve-e2e-get-platform-proxy-kv` namespace instead and create it only if it is missing, the same way the suite already handles its target Workers. The key is only written when it is missing, so normal runs never create or write anything. Also space out test retries so they outlast longer preview API outages.
|
|
LGTM! |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
There was a problem hiding this comment.
Superseded by the review of
7196cd3d.
This review, of 931ff76f
💬 Approved with comments — Test-only change with no correctness problems. Two INFO notes point out comments that describe the cleanup and the missing-key read inaccurately.
Findings: 2 info (2 are inline comments on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info
One misleading doc comment in the readKvValue helper.
Recommendation: 💬 Optional Nits
- [INFO] readKvValue doc comment describes a "Value not found" read that only happens in local mode (
fixtures/get-platform-proxy-remote-bindings/tests/index.test.ts:388)
View full review
readKvValue's doc comment says a missing key reads as Wrangler's "Value not found" message. That message is only logged in local mode (packages/wrangler/src/kv/index.ts:774). With--remote, a missing key makes the command throw, so the helper returnsundefined. The!== remoteKvValuecheck is correct either way.
📝 Documentation: 💬 1 info
The new comment misstates why the shared namespace survives the scheduled cleanup.
Recommendation: 💬 Optional Nits
- [INFO] Comment misattributes why the shared KV namespace is skipped by the scheduled cleanup (
fixtures/get-platform-proxy-remote-bindings/tests/index.test.ts:30)
View full review
- The comment says the
preserve-e2e-prefix keeps the namespace out of the scheduled cleanup. KV cleanup actually selects titles that containtmp-e2eortmp_e2e(tools/e2e/common.ts,listTmpKVNamespaces), so the namespace is safe because its title doesn't match, not because of the prefix.
✅ All other checks passed
🔒 Security: ✅ LGTM
No security concerns in this test-only change.
📖 AGENTS.md: ✅ LGTM
No repository guidance is affected.
⚡ Performance: ✅ LGTM
Normal runs no longer create, write to or delete a namespace. They make one list call and one read call instead.
Reviewed commit: 931ff76f
There was a problem hiding this comment.
💬 Approved with comments — Test-only change with no correctness problems. One INFO note remains: a comment gives the wrong reason the shared KV namespace survives the scheduled cleanup.
Findings: 1 info (1 is an inline comment on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📝 Documentation: 💬 1 info
One comment gives the wrong reason the shared namespace survives cleanup.
Recommendation: 💬 Optional Nits
- [INFO] The comment says the
preserve-e2e-prefix keeps the shared KV namespace out of cleanup, but KV cleanup only matchestmp-e2e/tmp_e2etitles (fixtures/get-platform-proxy-remote-bindings/tests/index.test.ts:30)
View full review
tests/index.test.ts:29-32: the comment says thepreserve-e2e-prefix keeps the namespace out of the scheduled cleanup. KV cleanup (tools/e2e/common.ts,listTmpKVNamespaces) only selects titles that containtmp-e2eortmp_e2e. Thepreserve-e2e-prefix check applies only to Workers.
✅ All other checks passed
🔒 Security: ✅ LGTM
No security concerns.
📖 AGENTS.md: ✅ LGTM
No issues.
📋 Code Quality: ✅ LGTM
The readKvValue doc comment now says the helper returns undefined when the key is missing or the read fails, which matches the code. The retry settings in vitest.config.e2e.mts (2 retries, 15s apart) match the description.
⚡ Performance: ✅ LGTM
A normal run now makes one kv namespace list call and one kv key get call. The write fallback is bounded by vi.waitFor (45s). The new retry delay only applies when a test fails.
Reviewed commit: 7196cd3d
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
The
getPlatformProxy()remote-bindings E2E suite created a fresh KV namespace inbeforeAlland wrote a test key to it. A brand-new namespace sometimes rejects writes withnamespace not found [code: 10013]for longer than setup waits, which fails the whole suite (example). The retry added in #16873 hasn't been enough. This is the most common failure of the step in recent Wrangler E2E runs, on every OS.The suite now looks up a shared
preserve-e2e-get-platform-proxy-kvnamespace and creates it only if it's missing. That's how it already handles itspreserve-e2e-*target Workers. The key is only written when it's missing, so normal runs neither create nor write anything. Concurrent runs can't interfere, because the tests only read it. Thepreserve-e2e-prefix keeps the scheduled cleanup away from it.This also spaces out test retries (2 retries, 15s apart). The preview API (
edge-preview) outages seen in the same job lasted 40s or more, longer than the current retries cover.