Skip to content

Commit 88a2698

Browse files
test(webapp): make routing settlement check race-safe
1 parent 1c12524 commit 88a2698

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

standalone/webapp/tests/e2e/edge-line-jump-integrity.spec.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -363,37 +363,38 @@ test.describe("Line-jump geometry integrity", () => {
363363

364364
const beforeRelease = await readPerf(page, true)
365365
await page.mouse.up()
366-
let duringSettlement: Awaited<ReturnType<typeof checkIntegrity>> | undefined
366+
let afterRelease: Awaited<ReturnType<typeof checkIntegrity>> | undefined
367367
await expect
368368
.poll(
369369
async () => {
370370
const snapshot = await checkIntegrity(page, true)
371371
if (
372372
snapshot.perf &&
373373
snapshot.perf.workerReleaseExactMaxMs >
374-
beforeRelease.workerReleaseExactMaxMs &&
375-
snapshot.perf.routingPreviewCount > 0
374+
beforeRelease.workerReleaseExactMaxMs
376375
) {
377-
duringSettlement = snapshot
376+
afterRelease = snapshot
378377
return true
379378
}
380379
return false
381380
},
382381
// Poll gently: a 5ms interval re-ran the full DOM integrity scan ~200×/s
383-
// and starved the very Worker message-handling it was waiting on.
382+
// and starved the very Worker message-handling it was waiting on. The
383+
// release-exact result and preview teardown may commit atomically, so do
384+
// not require a painted frame where both telemetry states overlap.
384385
{ intervals: [100, 250, 500], timeout: 15_000 }
385386
)
386387
.toBe(true)
387388

388-
expect(duringSettlement).toBeDefined()
389+
expect(afterRelease).toBeDefined()
389390
expect(
390-
duringSettlement!.crossings.length,
391-
"fixture no longer produces crossings during settlement"
391+
afterRelease!.crossings.length,
392+
"fixture no longer produces crossings after settlement"
392393
).toBeGreaterThan(0)
393394
expect(
394-
duringSettlement!.floating,
395-
`bridges floating during settlement: ${JSON.stringify(
396-
duringSettlement!.floatingDiagnostics
395+
afterRelease!.floating,
396+
`bridges floating after settlement: ${JSON.stringify(
397+
afterRelease!.floatingDiagnostics
397398
)}`
398399
).toEqual([])
399400
})

0 commit comments

Comments
 (0)