Skip to content

Commit cdecffe

Browse files
David Engelhartclaude
andcommitted
lumopolis: on a macOS or Linux CI runner only, the typing e2e lists the runner's busiest processes as the compiles end, since the whole runner is full while Electron uses about half of one core
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f945e40 commit cdecffe

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎e2e/world-view.spec.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* The fixture projects, the launch (labelling off, software GL) and the Add Terminal dialog come from
2727
* e2e/helpers/world.ts, which e2e/world-export.spec.ts shares.
2828
*/
29+
import { execFileSync } from 'node:child_process'
2930
import { test, expect, type ElectronApplication, type Page } from '@playwright/test'
3031
import { quitApp, ensureE2eBuild } from './helpers/launch'
3132
import { makeRepo, PROJECT_FILES, launchWorldApp, createTerminal as addTerminal, paletteType, removeDirs, expectPaneOpens } from './helpers/world'
@@ -595,6 +596,18 @@ test.describe.serial('Lumopolis in the real app', () => {
595596
console.log(`[typing while compiling, frames] page frames during compiles ${rafOf(true)}; with none running ${rafOf(false)}`)
596597
console.log(`[typing while compiling, page] page timer lateness during compiles ${lagOf(pageDiag.lag.filter((x) => pageIn(x[0])).map((x) => x[1]))}, with none running ${lagOf(pageDiag.lag.filter((x) => !pageIn(x[0])).map((x) => x[1]))}; during ${compileMs.toFixed(0)} ms of compiles ${longOf(true)}; with none running ${longOf(false)}; during compiles ${framesOf(true)}; with none running ${framesOf(false)}`)
597598
console.log(`[typing while compiling, main] ${cores} cores; main timer lateness during compiles ${lagOf(diag.lag.filter((x) => inRun(x[0])).map((x) => x[1]))}, with none running ${lagOf(diag.lag.filter((x) => !inRun(x[0])).map((x) => x[1]))}; Electron CPU during compiles ${cpuOf(true)}; with none running ${cpuOf(false)}`)
599+
// On a CI runner only (macOS and Linux, never a developer's machine): the runner's busiest processes as the
600+
// compiles end, so a machine that is full while Electron uses little of it shows what else holds the cores.
601+
if (process.env.CI && process.platform !== 'win32') {
602+
try {
603+
const args = process.platform === 'darwin' ? ['-Ao', 'pcpu,pid,ppid,etime,comm', '-r'] : ['-eo', 'pcpu,pid,ppid,etime,comm', '--sort=-pcpu']
604+
const out = execFileSync('ps', args, { encoding: 'utf8', timeout: 10_000 })
605+
const rows = out.split('\n').slice(0, 16).map((l) => ` ${l.slice(0, 160)}`)
606+
console.log(`[typing while compiling, runner] busiest processes:\n${rows.join('\n')}`)
607+
} catch (e) {
608+
console.log(`[typing while compiling, runner] ps failed: ${String(e)}`)
609+
}
610+
}
598611
expect(r.compiling, 'the compiles were still running after 60 s of typing').toBe(false)
599612
expect(r.compileError ?? null).toBeNull()
600613
// Only keys pressed while a compile ran count: that leaves out the warm-up, the gaps between

0 commit comments

Comments
 (0)