Public: anyone can read this; the crew can change it.
Flaky test: on production's size > a cold home answers from the picture, within a few passes over the runs #17166
Merged 40h 8m ago, live in production
scout/forge:scout/17033-flaky-test-on-production-s-size-a-cold-h → main 0 commits fork
1 file
changed +19
−10
test/observability-budget.test.ts +19 −10
| @@ -120,16 +120,25 @@ describe("on production's size", () => { | ||
| 120 | 120 | |
| 121 | 121 | test("a cold home answers from the picture, within a few passes over the runs", async () => { |
| 122 | 122 | await get("/"); |
| 123 | // what this budget measures is the cold path, a miss on every one of them and on the regions home remembers (#7660). | |
| 124 | // what this budget measures is the cold path, a miss on every one of them, not a warm hit. | |
| 125 | app.db.run("UPDATE repo SET description = description || ''"); | |
| 126 | for (const cache of [kpiCache(app.db), panelCache(app.db)]) cache.clear(); | |
| 127 | forgetHome(app.db); | |
| 128 | const res = await timedAgainstUnit("/"); | |
| 129 | expect(res.status).toBe(200); | |
| 130 | // the home reads no table itself: the lanes' worker does, and the page is drawn from its picture | |
| 131 | expect(names(res.timing)).toContain("picture"); | |
| 132 | expect(res.ms).toBeLessThan(30 * res.unit); | |
| 123 | // what this budget measures is the cold path, a miss on every one of them and on the regions | |
| 124 | // home remembers (#7660). CPU is shared with whatever else the process does (a worker finishing | |
| 125 | // an earlier page, the collector), and one stray burst inside the window failed this twice in a | |
| 126 | // week (#17033). A real regression is slow on every cold try, a stray burst on one: the budget | |
| 127 | // is met when the best of three cold tries meets it. | |
| 128 | let best: Awaited<ReturnType<typeof timedAgainstUnit>> | undefined; | |
| 129 | for (let attempt = 0; attempt < 3; attempt++) { | |
| 130 | app.db.run("UPDATE repo SET description = description || ''"); | |
| 131 | for (const cache of [kpiCache(app.db), panelCache(app.db)]) cache.clear(); | |
| 132 | forgetHome(app.db); | |
| 133 | const res = await timedAgainstUnit("/"); | |
| 134 | expect(res.status).toBe(200); | |
| 135 | // the home reads no table itself: the lanes' worker does, and the page is drawn from its | |
| 136 | // picture | |
| 137 | expect(names(res.timing)).toContain("picture"); | |
| 138 | if (best === undefined || res.ms / res.unit < best.ms / best.unit) best = res; | |
| 139 | if (res.ms < 30 * res.unit) break; | |
| 140 | } | |
| 141 | expect(best!.ms).toBeLessThan(30 * best!.unit); | |
| 133 | 142 | }); |
| 134 | 143 | }); |
| 135 | 144 |
new above
offline