Skip to main content
← Back to list
01Issue
BugShippedExtensionsPublic
Assigneesstack72

Relationships

#3942 swamp-extensions GCS storage test 'put: an abort mid-upload leaves no object and no resumable session' fails about 1 run in 5 (fixed 50 ms sleeps)

Opened by stack72 · 10/25/2026· Shipped 10/26/2026

What happens

In swamp-extensions, datastore/gcs/extensions/datastores/_lib/gcs_storage_test.ts › "put: an abort mid-upload leaves no object and no resumable session" fails intermittently with:

error: AssertionError: Values are not equal.
-   true
+   false
    at gcs_storage_test.ts:133

That is assertEquals(state.objects.has(chunkKey(sha256)), false): the emulator stored the aborted chunk.

Where it was seen

  • verify-build for the swamp-club#3941 extension PR failed on it (run a192b1e7). A rerun of verify-build alone passed (cff72f5a).
  • On swamp-extensions origin/main (2026-10-25) the test failed 4 times in 20 when run alone on macOS. The test, gcs_storage.ts and gcs_emulator_test_util.ts are unchanged on that PR's branch, so the flake is pre-existing.

Likely cause

The test aborts the upload, then waits a fixed 50 ms for the emulator to see the connection close, releases the held request, and waits another fixed 50 ms before asserting. When the emulator reads the complete body before it notices the abort (the test's own comment names this case for Windows, where the loopback buffers the body), it commits the object. The fixed sleeps make the outcome timing-dependent.

Fix

Replace the fixed sleeps with a condition: have the emulator report when the held request finished (aborted or completed), and waitFor that, or assert on the request's outcome rather than racing the commit. swamp's test rules forbid fixed sleeps for async work for this reason.

Done when

  • The test passes 50 of 50 runs in a loop on macOS and Linux.
02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 8 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

10/26/2026, 12:34:35 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack7210/25/2026, 9:49:31 PM
Editable. Press Enter to edit.

system commented 10/25/2026, 9:42:17 PM

Classified automatically when this issue was filed.

  • Source: Extensions

If you feel this classification is incorrect, add a ripple to tell us so.

Sign in to post a ripple.