From 97e192ebce29c996680577ecb360f5217c2ec858 Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Tue, 10 Nov 2026 21:25:08 +0400 Subject: [PATCH] Request frames again while waiting for tiles and transitions A request-mode globe updates its tile state only on drawn frames, so tile and UI readiness that never asked for one waited until something else drew: imagery, weather and ground scenarios took several times longer. The idle checks measure through their own passive observer and are not affected. --- scripts/qa/ready.mjs | 3 +++ scripts/qa/ready.test.mjs | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/qa/ready.mjs b/scripts/qa/ready.mjs index ef75ffeb6..99456825e 100644 --- a/scripts/qa/ready.mjs +++ b/scripts/qa/ready.mjs @@ -210,6 +210,8 @@ export async function whenTilesLoaded(page, { timeoutMs = 30000 } = {}) { () => { const engine = window.__godsEyeView?.engine; if (!engine || engine.isDestroyed()) return false; + // A request-mode globe only updates tile state on drawn frames. + engine.render.request('qa-tile-readiness'); return engine.surface.tilesLoaded(); }, { timeout: timeoutMs, polling: 100 }, @@ -221,6 +223,7 @@ export async function whenUiSettled(page) { const handle = await page.waitForFunction( () => { const app = window.__godsEyeView; + app?.engine?.render.request('qa-ui-readiness'); return ( !app?.styleManager?.transitions?.size && document diff --git a/scripts/qa/ready.test.mjs b/scripts/qa/ready.test.mjs index cff54c5bb..06ac8cf4f 100644 --- a/scripts/qa/ready.test.mjs +++ b/scripts/qa/ready.test.mjs @@ -287,7 +287,7 @@ test('camera readiness also waits for the startup cover to stop intercepting cli }); }); -test('tile and UI polling never request globe frames', async (t) => { +test('tile and UI polling request frames so a request-mode globe progresses', async (t) => { const { engine } = pageEngine(t); const previous = globalThis.document; globalThis.document = { getAnimations: () => [] }; @@ -295,9 +295,8 @@ test('tile and UI polling never request globe frames', async (t) => { if (previous === undefined) delete globalThis.document; else globalThis.document = previous; }); - t.mock.method(engine.render, 'request', () => { - assert.fail('passive readiness requested a frame'); - }); + const reasons = []; + t.mock.method(engine.render, 'request', (reason) => reasons.push(reason)); const page = { async waitForFunction(predicate) { assert.equal(predicate(), true); @@ -306,4 +305,5 @@ test('tile and UI polling never request globe frames', async (t) => { }; await whenTilesLoaded(page); await whenUiSettled(page); + assert.deepEqual(reasons, ['qa-tile-readiness', 'qa-ui-readiness']); });