Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
test(cockpit): expose cancelled expand stages [N26]
Corey Olson823482a1142f
diff --git a/test/cockpit/roadmap.test.js b/test/cockpit/roadmap.test.jsindex 7f64322d..46eb7402 100644--- a/test/cockpit/roadmap.test.js+++ b/test/cockpit/roadmap.test.js@@ -1366,11 +1366,18 @@ async function startStressView(board) {}test('expanding a roadmap row paints its detail within 100 ms [N26]', { timeout: 180_000 }, async (t) => {+ const began = performance.now();+ /** Name actual stage boundaries without changing either the hang ceiling or paint assertions. */+ const stage = phase => console.log('roadmap-expand-stage ' + JSON.stringify({ phase, elapsedMs: Math.round(performance.now() - began) }));const executable = chromeExecutable();assert.ok(executable, 'Chrome is required to time a roadmap expand.');// A board our size: 1,038 items with their events, shouts and releases.+ stage('seed-start');const board = generateStressBoard({ seed: 'roadmap-expand-1039', size: 1_038 });+ stage('seed-end');+ stage('view-start');const view = await startStressView(board), profile = mkdtempSync(join(tmpdir(), 'pullboard-roadmap-expand-chrome-'));+ stage('view-ready');const row = (key) => `[...document.querySelectorAll('#roadmap .milestone-item')].find((each) => each.dataset.roadmapKey === ${JSON.stringify(key)})`;const why = (key) => `${row(key)}.parentElement.querySelector('.milestone-why')`;/** Click one row and return what the frame after the click painted. */@@ -1382,19 +1389,25 @@ test('expanding a roadmap row paints its detail within 100 ms [N26]', { timeout:const reads = async () => JSON.parse(await chrome.stable('JSON.stringify({ asked: window.__asked, answered: window.__answered })'));let chrome;try {+ stage('chrome-start');chrome = await openRoadmapChrome(executable, 'about:blank', profile);+ stage('chrome-ready');await chrome.send('Page.addScriptToEvaluateOnNewDocument', { source: SLOW_DETAIL });await chrome.send('Page.navigate', { url: view.link.href });await chrome.waitFor('data?.project?.items?.length === 1038', 30_000); // budget: hang ceiling for the first read of a board our size.+ stage('state-ready');await press(chrome, "document.querySelector('[data-tab=roadmap]')");await chrome.waitFor("view.tab === 'roadmap' && document.querySelectorAll('#roadmap .milestone-item').length > 100", 30_000); // budget: hang ceiling for the first roadmap draw.+ stage('roadmap-ready');// A row below the fold, never fetched ahead: its detail can only come from the delayed request.const far = await chrome.stable(`[...document.querySelectorAll('#roadmap .milestone-item[aria-expanded=false]')].filter((each) => /^i:#\\d+$/u.test(each.dataset.roadmapKey)&& !each.closest('[hidden]') && each.getBoundingClientRect().top > innerHeight * 2).at(-1)?.dataset.roadmapKey`);assert.ok(far, 'the roadmap has a row below the fold');const farPath = '/items/' + far.slice(3);assert.equal((await reads()).asked.filter((path) => path.endsWith(farPath)).length, 0, 'the row below the fold was not read ahead');+ stage('first-expand-start');const painted = await expand(far);+ stage('first-expand-ready');t.diagnostic(`click to paint ${Math.round(painted.ms)} ms on ${far}`);assert.equal(painted.expanded, 'true'); assert.equal(painted.shown, true, 'the row opens in the frame after the click');assert.equal(painted.loading, false, 'no loading state shows'); assert.equal(painted.block, true, 'the row paints its block at once');@@ -1408,7 +1421,9 @@ test('expanding a roadmap row paints its detail within 100 ms [N26]', { timeout:// A second expand is instant: its detail is kept, so it paints whole and reads nothing.const asked = (await reads()).asked.length;await chrome.click(row(far));+ stage('repeat-expand-start');const again = await expand(far);+ stage('repeat-expand-ready');assert.ok(again.fields.includes('Criterion') && again.ms < 100, `a second expand paints whole at once: ${JSON.stringify(again)}`);// A row scrolled onto the screen is read ahead, so its first expand paints whole.const near = await chrome.stable(`[...document.querySelectorAll('#roadmap .milestone-item[aria-expanded=false]')].find((each) => /^i:#\\d+$/u.test(each.dataset.roadmapKey)@@ -1417,7 +1432,9 @@ test('expanding a roadmap row paints its detail within 100 ms [N26]', { timeout:await chrome.stable(`${row(near)}.scrollIntoView({ block: 'center', behavior: 'instant' }); true`);// Read ahead and drawn into the folded row once the queue drains.await chrome.waitFor(`window.__answered.some((path) => path.endsWith(${JSON.stringify('/items/' + near.slice(3))})) && !!${why(near)}.querySelector('.roadmap-criterion')`, 20_000); // budget: hang ceiling for the read ahead queue.+ stage('ahead-expand-start');const ahead = await expand(near);+ stage('ahead-expand-ready');assert.ok(ahead.fields.includes('Criterion') && !ahead.loading && ahead.ms < 100, `a row read ahead paints whole at once: ${JSON.stringify(ahead)}`);assert.equal((await reads()).asked.filter((path) => path.endsWith(farPath)).length, 1, 'the far row was read once');// A background refresh that moves no item reads no detail again.@@ -1430,10 +1447,15 @@ test('expanding a roadmap row paints its detail within 100 ms [N26]', { timeout:await chrome.waitFor('window.__asked.length === window.__answered.length', 10_000); // budget: hang ceiling for any read the refresh started.assert.deepEqual((await reads()).asked.slice(settledReads.length), [], 'the refresh fetched no detail of an item that has not moved');assert.deepEqual(chrome.exceptions, [], 'the roadmap raises no uncaught page exception');+ stage('body-end');} finally {+ stage('cleanup-start');if (chrome) await closeSnapshotChrome(chrome);+ stage('chrome-closed');rmSync(profile, { recursive: true, force: true });await view.stop();+ stage('view-stopped');removeStressBoard(board);+ stage('cleanup-end');}});