Reset maxAtlasPages after tests that lower it

setMaxAtlasPages mutates a static that lives for the page's lifetime, so a
lowered cap silently leaked into every renderer built by later tests in the
same file (their GL texture and shader sampler arrays were sized at the tiny
cap, making tests order-dependent). Add resetMaxAtlasPages and call it in
afterEach wherever the cap is lowered on a shared page.
This commit is contained in:
Anthony Kim
2026-07-04 13:04:11 -07:00
parent f9b043274d
commit fab7bc3c5a
5 changed files with 31 additions and 8 deletions
@@ -23,6 +23,7 @@ import {
captureRowSignatures,
expectSignatureMatches,
loadWebglStrict,
resetMaxAtlasPages,
setMaxAtlasPages,
writeAndWaitForRender
} from '../../../test/playwright/RendererTestUtils';
@@ -96,13 +97,7 @@ test.describe('atlas page overflow (#322756 class)', () => {
} finally {
ctx.page.off('pageerror', onError);
// Restore the default so a lowered cap can never leak into other tests.
await ctx.page.evaluate(() => {
const renderer = (window as any).term._core._renderService._renderer.value;
const atlas = renderer?._charAtlas;
if (atlas) {
(atlas.constructor as any).maxAtlasPages = undefined;
}
}).catch(() => { /* page may already be unusable after a crash */ });
await resetMaxAtlasPages(ctx).catch(() => { /* page may already be unusable after a crash */ });
await ctx.page.close();
}
});