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:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user