Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion scripts/screenshots/journeys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,16 @@ await journey('sign-in-redirects-at-once-and-lists-after', async ({ page, shot }
// little more. The listing alone takes 8 s here, so a callback that waited for it fails either way
expect(ms < 1500, `the sign-in callback took ${ms} ms`)
const timed = await (await page.request.get(`${GITHUB}/_stub/timed`)).json()
const inCallback = timed.filter((c) => c.started >= asked && c.finished !== null && c.finished <= answered).map((c) => c.call)
// The callback's calls are the stub's calls after the browser's own GET /login/oauth/authorize (which sends it to the
// callback) that finished before the callback answered: counted by order, not from `asked`. Both clocks are whole
// milliseconds and the browser's events reach this process late, so a window from `asked` both took in authorize
// (5 Dec 2026, run 47531375940: "4 GitHub calls") and could leave out the callback's first call
const from = timed.findLastIndex((c) => c.call === 'GET /login/oauth/authorize')
expect(from >= 0, 'the stub never saw the sign-in authorize request')
const inCallback = timed
.slice(from + 1)
.filter((c) => c.finished !== null && c.finished <= answered)
.map((c) => c.call)
expect(inCallback.length <= 3, `the sign-in callback made ${inCallback.length} GitHub calls: ${inCallback.join(', ')}`)

// An installation set up meanwhile waits on the listing: the page that loads itself again every second, served once
Expand Down
Loading