Public: anyone can read this; the crew can change it.
The child forge's linked-sub sign-in test passes on a loaded check host #9985
Check · Review · Land · Live done — Landed and live in production.
This change makes the linked-sub sign-in test say which step of the sign-in failed, instead of crashing on a missing redirect. **It does not find or fix the cause of #9963's red check:** I could not reproduce the failure, and I won't claim a fix.
shipped production is serving it deploy f21b126
This change makes the linked-sub sign-in test say which step of the sign-in failed, instead of crashing on a missing redirect. It does not find or fix the cause of #9963's red check: I could not reproduce the failure, and I won't claim a fix.
What I found. The check log has only the failure line, (fail) … [5.59ms] [shard 22], and no error text. The test normally takes about 75 ms, and the three parent sign-ins alone take about 47 ms. So at 5.59 ms it failed during the first sign-in. The likely spot is through() calling new URL(null!) when the child's /signin/parent or the parent's consent did not answer with a redirect (303). I checked the three causes the issue suggests:
- Wall-clock windows: the sign-up and sign-in limits are 60-second sliding windows, and the test finishes far inside one.
- State from an earlier test: there is only one test in the file. Every limiter, the Shield cache and the key set are kept per forge. Mocked global
fetchandsetSystemTimeare put back by the files that use them. - Shared forges: the parent and child are started once in
beforeAll, but only this one test uses them.
The only state on that path shared by every forge in a process is the in-flight client-registration map in src/http/rp.ts. Two forges would only collide there if both their ports were reused at once, so I left it alone. A beforeAll timeout is also ruled out: bun 1.3.14 reports that as (fail) (unnamed) [5001ms], not a named test at 5 ms. The pull's own head (fe53573f) passes this file locally.
What changed (test only, no app code):
through()now checks each step before following it: the child's start must redirect to the parent's/oauth/authorize, and the consent must redirect to the child's/signin/parent/callback. The state cookie must be set. Otherwise it throws an error naming the step, its status, its location and the page's visible text. With the parent removed, it reads:the child's /signin/parent: 404, location none, … body: Could not sign you in This forge has no parent to sign in through.beforeAll, which starts two forges, now has 30 s instead of bun's 5 s default, as 303 other test files already do. This was not what failed in #9963; it only stops a slow boot from failing the file.- The test still proves all three claims in its name, with the same assertions.
How to try it (run here, sandbox with the loopback port):
bun test test/forge-signin-signup.test.ts20 times in a row, alongside a backgroundbun testofforge-to-forge-walk,forge-signin,smoke,webhooksandsignup-window: 20 pass, 0 fail. That background run ended before the 20 did. Before the change, with four such background runs in parallel, the test also passed 20 of 20, so it does not fail here at all.bun test test/forge-signin-signup.test.ts -t 'linked sub': 1 pass.bun scripts/gate.tsandbun x tsc --noEmit: both pass.
Not done: the issue's first two checkboxes (find the cause, fix it) stay open. The next time this test goes red, the log will name the step and the forge's own reason. The keep_plan tool was not available in this run, so no plan was kept on the issue.
🤖 Generated with Claude Code
Test-only change in test/forge-signin-signup.test.ts. A red in the linked-sub sign-in test now names the failing hop, its status, its location and the page text, where it used to crash on new URL(null). The beforeAll timeout is 30 s, like other files that boot forges. The three claims in the test name are untouched, and there is no app code, new dependency, README or UI change. I read the diff only and did not run the tests. The pull says plainly that it does not find the cause, which is honest. Two things I would do next: (1) when the test next goes red, use the new message to find the real cause and fix it, since the issue is not closed by this pull; (2) if the cause turns out to be the unnamed shared state in src/http/rp.ts, give that state a test that fails without the fix.
Left #9978 open: 2 unticked items remain (Find what makes it order- or time-sensitive: a sign-up window or throttle counted against the wall clock, state left by an earlier test in the file, or a parent/child forge started per file and shared across tests. Say which in the pull.; Fix the test, or the code if the code is wrong (say which). The test still proves all three claims in its name.).
This change makes the linked-sub sign-in test say which step of the sign-in failed, instead of crashing on a missing redirect. It does not find or fix the cause of #9963's red check: I could not reproduce the failure, and I won't claim a fix.
What I found. The check log has only the failure line,
(fail) … [5.59ms] [shard 22], and no error text. The test normally takes about 75 ms, and the three parent sign-ins alone take about 47 ms. So at 5.59 ms it failed during the first sign-in. The likely spot isthrough()callingnew URL(null!)when the child's/signin/parentor the parent's consent did not answer with a redirect (303). I checked the three causes the issue suggests:fetchandsetSystemTimeare put back by the files that use them.beforeAll, but only this one test uses them.The only state on that path shared by every forge in a process is the in-flight client-registration map in
src/http/rp.ts. Two forges would only collide there if both their ports were reused at once, so I left it alone. AbeforeAlltimeout is also ruled out: bun 1.3.14 reports that as(fail) (unnamed) [5001ms], not a named test at 5 ms. The pull's own head (fe53573f) passes this file locally.What changed (test only, no app code):
through()now checks each step before following it: the child's start must redirect to the parent's/oauth/authorize, and the consent must redirect to the child's/signin/parent/callback. The state cookie must be set. Otherwise it throws an error naming the step, its status, its location and the page's visible text. With the parent removed, it reads:the child's /signin/parent: 404, location none, … body: Could not sign you in This forge has no parent to sign in through.beforeAll, which starts two forges, now has 30 s instead of bun's 5 s default, as 303 other test files already do. This was not what failed in #9963; it only stops a slow boot from failing the file.How to try it (run here, sandbox with the loopback port):
bun test test/forge-signin-signup.test.ts20 times in a row, alongside a backgroundbun testofforge-to-forge-walk,forge-signin,smoke,webhooksandsignup-window: 20 pass, 0 fail. That background run ended before the 20 did. Before the change, with four such background runs in parallel, the test also passed 20 of 20, so it does not fail here at all.bun test test/forge-signin-signup.test.ts -t 'linked sub': 1 pass.bun scripts/gate.tsandbun x tsc --noEmit: both pass.Not done: the issue's first two checkboxes (find the cause, fix it) stay open. The next time this test goes red, the log will name the step and the forge's own reason. The
keep_plantool was not available in this run, so no plan was kept on the issue.🤖 Generated with Claude Code
Closes #9978