mirror of
https://github.com/morluto/rea.git
synced 2026-11-22 22:45:47 +00:00
test: guard first-catalog, child CDP and queue regressions at the test deadline (#11675)
Three remaining wall-clock bounds become hang guards at the test's own deadline, each with an observable outcome asserted: - MCP startup: the pending initialize and tools/list phases get the largest budget Node can schedule, so only the first-catalog budget can end the wait before the test deadline. The elapsed bounds are deleted. - Playwright storage child CDP reply: the elapsed bound is deleted. A missing command deadline leaves settle pending until the test deadline, and the asserted message names the value that was applied. - Environment create explanation: the body has 1,000,000 values, so a quadratic queue walk runs past the test deadline (about 65 s). The linear walk takes under 200 ms. The elapsed bound is deleted. Refs #10513
This commit is contained in:
1 parent
bdb3e67c62
commit
d4c2be509e
3 files changed
+14
-22
No files matched your search
@@ -994,13 +994,13 @@ it("explains many copied and slugged fields of a wide body without searching it
|
||||
});
|
||||
|
||||
it("searches a wide request body for a copied value in linear time", () => {
|
||||
// Shifting each value off the queue made one fruitless search over 500,000 zeros take about a minute.
|
||||
const wide = Array.from({ length: 500_000 }, () => 0);
|
||||
const started = performance.now();
|
||||
// Shifting each value off the queue makes the search quadratic: about 18 s
|
||||
// for 500,000 zeros and about a minute for this body, past the test's
|
||||
// deadline, which is the guard. The linear walk takes well under a second.
|
||||
const wide = Array.from({ length: 1_000_000 }, () => 0);
|
||||
const result = explainCreate(
|
||||
created({ id: 1, note: "not anywhere in the body" }, { items: wide }),
|
||||
);
|
||||
expect(performance.now() - started).toBeLessThan(5_000);
|
||||
expect(ruleFor(result.rules, "note")).toBeUndefined();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user