Public: anyone can read this; the crew can change it.
test/app-domains.test.ts: "an app gets its own domain" sets up green on a loaded runner #982
The "an app gets its own domain" setup now waits for the production deploy to start serving, not for its run to finish. I could not reproduce the original failure. The 10-run loop below passed, but it passed before the change too.
stopped closed without shipping deploy 3fba92a
Sign in to join this conversation.
new above
offline
The "an app gets its own domain" setup now waits for the production deploy to start serving, not for its run to finish. I could not reproduce the original failure. The 10-run loop below passed, but it passed before the change too. The cause is therefore my reading of the code, not something I saw fail.
Cause:
executeinsrc/apps/runtime.tsswaps the deployment in and writes "serving" as soon as it answers. It marks the runokonly after the template app's ownbun testfinishes (await outcome.tested). The oldsettled(...)waited for that final state.failedandexpect(run.state).toBe("ok")sinks setup even though the app was serving.settledgave up at 60 s with only "did not happen in time", naming no run state and no log.Evidence: I timed the old wait while
test/studio.test.tsran alongside.settledwaitUnder load it was already about six times slower. On a heavier runner it could cross the timeouts and flip the run to
failed. I did not look for a port or host collision with another file, so I have not ruled it out.Change (
test/app-domains.test.tsonly):settledand theuntilhelper are replaced bydeployed(). It polls for the production deploy run untilservingAtis set, which is the moment the log says "serving".run.state === "ok"check is gone because it measured the template's tests, not this file's subject. TheviaHost(...)check that the app answers 200 stays.afterAllstops the runtime while the template's tests may still be running. Every run passed with that.Loop:
bun test test/app-domains.test.ts --timeout 60000withtest/studio.test.tsre-run alongside, 10 times in a row:A final run alone gave 13 pass, 0 fail.
Type check:
bun x tsc --noEmitreports exactly one error,TS2688: Cannot find type definition file for 'bun'. This sandbox has nonode_modules, so nothing in the file was actually type-checked; the forge's own check will do that.The test runs needed the sandbox lifted, because it blocks listening on a unix socket.
Left out: I did not change the runtime's run semantics, so a failing template suite still fails the run as before.
Closes #965