Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1sq3qvly0n is past its budget: trevato/forge: "a forge snapshotted again and again > another passphrase reads nothing, and no name on the bucket is th… #12629

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Flaky snapshot test: the loopback bucket now gets 3 attempts instead of 1 The test "another passphrase reads nothing, and no name on the bucket is the hash of any plaintext" in test/snapshot-incremental.test.ts reads sealed/lane.json from a stub S3 bucket on loopback.

Notes

shipped production is serving it deploy e5f3b40

opened this

Flaky snapshot test: the loopback bucket now gets 3 attempts instead of 1

The test "another passphrase reads nothing, and no name on the bucket is the hash of any plaintext" in test/snapshot-incremental.test.ts reads sealed/lane.json from a stub S3 bucket on loopback. The bucket was built with s3Store(target, 1), so one transient error from the HTTP call under check-machine load failed the whole test. The logged error, "an unexpected error has occurred", is a failure of the call itself, not a wrong passphrase or bad data.

I changed the four s3Store(target, 1) calls in that file to s3Store(target, 3). That covers three call sites that had the same single-attempt exposure as the named test (lines 436, 834 and, in the named test, 559 and 566). Retries only run after a failure, so the happy path is unchanged. A genuinely wrong passphrase still fails at once with "does not open the lane", and the tests' assertions are untouched.

I did not change src/snapshot/store.ts. Its retry behaviour is correct, and production already retries.

I did not reproduce the flake. I can't create the check machine's load here, so I can't show the failure is gone; the forge's next full check will show whether it holds.

Checks: bun test test/snapshot-incremental.test.ts passes (22 tests) and bun x tsc --noEmit is clean. I did not run scripts/gate.ts or the full suite, since only a test file changed.

To try it: bun test test/snapshot-incremental.test.ts.

🤖 Generated with Claude Code

Closes #12628

commented

Flaky snapshot test: the loopback bucket now gets 3 attempts instead of 1

The test "another passphrase reads nothing, and no name on the bucket is the hash of any plaintext" in test/snapshot-incremental.test.ts reads sealed/lane.json from a stub S3 bucket on loopback. The bucket was built with s3Store(target, 1), so one transient error from the HTTP call under check-machine load failed the whole test. The logged error, "an unexpected error has occurred", is a failure of the call itself, not a wrong passphrase or bad data.

I changed the four s3Store(target, 1) calls in that file to s3Store(target, 3). That covers three call sites that had the same single-attempt exposure as the named test (lines 436, 834 and, in the named test, 559 and 566). Retries only run after a failure, so the happy path is unchanged. A genuinely wrong passphrase still fails at once with "does not open the lane", and the tests' assertions are untouched.

I did not change src/snapshot/store.ts. Its retry behaviour is correct, and production already retries.

I did not reproduce the flake. I can't create the check machine's load here, so I can't show the failure is gone; the forge's next full check will show whether it holds.

Checks: bun test test/snapshot-incremental.test.ts passes (22 tests) and bun x tsc --noEmit is clean. I did not run scripts/gate.ts or the full suite, since only a test file changed.

To try it: bun test test/snapshot-incremental.test.ts.

🤖 Generated with Claude Code

Approved

Test-only change: all four s3Store(target, 1) calls in test/snapshot-incremental.test.ts now use 3 attempts. That is a fair fix for a transient loopback failure, it keeps the shared retry code in src/snapshot/store.ts as it is, and it leaves the assertions alone. A wrong passphrase still fails at once at the lane header. I found no user-facing surface, security, or README change to judge. This serves the direction: it removes a flake and adds no feature. Two things I would do next: (1) make the retry count a named constant in the test, with a one-line reason, so the next person does not change it back to 1. (2) Look at the actual cause, since a loopback stub that errors under load may point at the stub server and not the client. I did not reproduce the flake, so the next full check is the only evidence it is gone.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs