test(web): raise the theme-flip waitFor budget
Pre-existing flake, not introduced here — the file is untouched by this branch and the test already carries a comment about failing this way once. The default 1000ms was still too tight: it failed twice consecutively under `npm run ci` (~1021ms, 0 calls) while passing every time the file runs alone, which is a budget signature rather than a broken observer. A generous `waitFor` costs nothing on the passing path. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0177mPHAdECD18nLLCTwR5rh Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
fafc8367b8
commit
80f76e365e
1 changed files with 18 additions and 9 deletions
|
|
@ -550,17 +550,26 @@ describe("AppRenderer", () => {
|
||||||
// many ticks happy-dom takes to deliver the MutationObserver callback is
|
// many ticks happy-dom takes to deliver the MutationObserver callback is
|
||||||
// load-dependent, so under a full parallel run the observer can still be
|
// load-dependent, so under a full parallel run the observer can still be
|
||||||
// pending here. Observed failing exactly once that way, with 0 calls.
|
// pending here. Observed failing exactly once that way, with 0 calls.
|
||||||
await waitFor(() =>
|
//
|
||||||
expect(bridge.sendHostContextChange).toHaveBeenCalledWith(
|
// The default 1000ms then turned out not to be enough either — it failed
|
||||||
expect.objectContaining({
|
// twice in a row in `npm run ci` (at ~1021ms, still 0 calls) while
|
||||||
theme: "dark",
|
// passing every time this file runs alone, which is the signature of a
|
||||||
styles: expect.objectContaining({
|
// budget that is too tight rather than of a broken observer. Raised
|
||||||
variables: expect.objectContaining({
|
// rather than retried: a `waitFor` that is generous costs nothing on the
|
||||||
"--color-background-primary": "#101113",
|
// passing path, since it returns as soon as the assertion holds.
|
||||||
|
await waitFor(
|
||||||
|
() =>
|
||||||
|
expect(bridge.sendHostContextChange).toHaveBeenCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
|
theme: "dark",
|
||||||
|
styles: expect.objectContaining({
|
||||||
|
variables: expect.objectContaining({
|
||||||
|
"--color-background-primary": "#101113",
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
),
|
||||||
),
|
{ timeout: 5000 },
|
||||||
);
|
);
|
||||||
} finally {
|
} finally {
|
||||||
getComputedStyleSpy.mockRestore();
|
getComputedStyleSpy.mockRestore();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue