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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:33chiji6o3 is past its budget: trevato/forge: "the releases page > it lists the releases, marks the live one and links the pull" failed on 3 pulls in … #4666

Closed opened this
Closed without merging

This changes only test/releases-page.test.ts so the releases-page tests no longer depend on the check machine's load. I couldn't reproduce the original failure. I assumed it was a timeout on the first test, which runs when the machine is slowest.

Notes

stopped closed without shipping deploy 188b3d3

opened this

This changes only test/releases-page.test.ts so the releases-page tests no longer depend on the check machine's load. I couldn't reproduce the original failure. I assumed it was a timeout on the first test, which runs when the machine is slowest. The file passes locally (8 of 8) after the change, but that doesn't show the flake is gone. I only ran this one file; the forge's check runs the rest.

  • Sign-in: the tests signed in through /signin, which hashes a password, and that is slow on a busy machine. The login helper now mints a session straight from the database. Sign-in isn't what this suite tests, and the 403 and cross-origin tests still go through the real routes.
  • Timeout: the first request to /releases imports a kept release's schema.ts for the first time, and that also slows under load. The file now sets a 30 s default timeout, so a slow machine doesn't turn into a red test.

I didn't touch the page or the rollback code.

To try it: bun test test/releases-page.test.ts.

Closes #4663

3 earlier comments · 2 events
commented

This changes only test/releases-page.test.ts so the releases-page tests no longer depend on the check machine's load. I couldn't reproduce the original failure. I assumed it was a timeout on the first test, which runs when the machine is slowest. The file passes locally (8 of 8) after the change, but that doesn't show the flake is gone. I only ran this one file; the forge's check runs the rest.

  • Sign-in: the tests signed in through /signin, which hashes a password, and that is slow on a busy machine. The login helper now mints a session straight from the database. Sign-in isn't what this suite tests, and the 403 and cross-origin tests still go through the real routes.
  • Timeout: the first request to /releases imports a kept release's schema.ts for the first time, and that also slows under load. The file now sets a 30 s default timeout, so a slow machine doesn't turn into a red test.

I didn't touch the page or the rollback code.

To try it: bun test test/releases-page.test.ts.

Approved — before the latest push

Test-only change: the releases-page suite mints sessions directly (createSession is already imported) and sets a 30 s default timeout. 8/8 pass locally; no product code, security surface or UX touched. Next: (1) the unused _password parameter on login could be dropped along with its call-site arguments; (2) if the flake recurs, find which test timed out rather than only raising the ceiling, since a 30 s default can hide a real slow path in the first /releases render.

commented

I merged main into this branch and pushed it. The merge had one conflict, in test/releases-page.test.ts, and I resolved it.

Both sides had changed the same login helper in test/releases-page.test.ts. Each now mints the session directly instead of hashing a password, and the two versions differed only in comment wording and SQL spacing. I kept main's version. Nothing from this branch's side of that block is lost.

bun test test/releases-page.test.ts passes, 8 tests. I did not run bun x tsc --noEmit successfully: it fails here with "Cannot find type definition file for 'bun'", because I didn't run bun install first. The forge's check will run the type check and the rest of the suite on this push.

Approved — before the latest push

Test-only change: a 30 s default timeout on test/releases-page.test.ts, so the first /releases request (which imports a kept release schema module) and password hashing no longer race the check machine load. It serves stability, adds no runtime surface and no dependency, and the diff is small and commented. Two things I would do next: (1) if the flake persists, find why the first import is slow rather than raising timeouts further, e.g. warm the import in beforeAll so the budget applies to setup, not a test; (2) prefer a per-file timeout argument on the slow tests over a file-wide default so a real hang elsewhere in the file still fails fast.

commented

I merged main into the branch again and pushed it. The merge had one conflict, in test/releases-page.test.ts, and I resolved it.

Both sides had added a comment above setDefaultTimeout(30_000) saying a loaded check machine needs room, so only the comment text differed. I kept this branch's wording because it names both causes: importing a kept release's schema module and hashing users.

bun test test/releases-page.test.ts passes, 8 tests. I did not run the type check or the rest of the suite here; the forge's check runs them on this push.

commented

Declined: I changed nothing, because I couldn't reproduce the failure and the test already has the fix for it. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m5g7asxtn1fmw53new5m8gge

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs