You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: reduce flakes on pages-dev e2e tests (#10280)
Occasionally this test flaked because the dev process output the bindings twice.
I believe this is a timings issue around watching for file changes, triggering a second update and printing of the bindings
So now we only extract the first bindings list and clean it up to make it resilient to flaking
env.TEST_DO (TestDurableObject, defined in a) Durable Object local [not connected]
125
-
env.TEST_KV (TEST_KV) KV Namespace local
126
-
env.TEST_D1 (local-TEST_D1) D1 Database local
127
-
env.TEST_R2 (TEST_R2) R2 Bucket local
128
-
env.TEST_SERVICE (test-worker) Worker local [not connected]
129
-
Service bindings, Durable Object bindings, and Tail consumers connect to other \`wrangler dev\` processes running locally, with their connection status indicated by [connected] or [not connected]. For more details, refer to https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#local-development
130
-
⎔ Starting local server...
131
-
[wrangler:info] Ready on http://<HOST>:<PORT>"
120
+
constbindingMessages=worker.currentOutput.split(
121
+
"Your Worker has access to the following bindings:"
122
+
);
123
+
constbindings=Array.from(
124
+
(bindingMessages[1]??"").matchAll(/env\.[^\n]+/g)
125
+
).flat();
126
+
expect(bindings).toMatchInlineSnapshot(`
127
+
[
128
+
"env.TEST_DO (TestDurableObject, defined in a) Durable Object local [not connected]",
129
+
"env.TEST_KV (TEST_KV) KV Namespace local",
130
+
"env.TEST_D1 (local-TEST_D1) D1 Database local",
131
+
"env.TEST_R2 (TEST_R2) R2 Bucket local",
132
+
"env.TEST_SERVICE (test-worker) Worker local [not connected]",
0 commit comments