|
26 | 26 | * The fixture projects, the launch (labelling off, software GL) and the Add Terminal dialog come from |
27 | 27 | * e2e/helpers/world.ts, which e2e/world-export.spec.ts shares. |
28 | 28 | */ |
| 29 | +import { execFileSync } from 'node:child_process' |
29 | 30 | import { test, expect, type ElectronApplication, type Page } from '@playwright/test' |
30 | 31 | import { quitApp, ensureE2eBuild } from './helpers/launch' |
31 | 32 | 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', () => { |
595 | 596 | console.log(`[typing while compiling, frames] page frames during compiles ${rafOf(true)}; with none running ${rafOf(false)}`) |
596 | 597 | 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)}`) |
597 | 598 | 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 | + } |
598 | 611 | expect(r.compiling, 'the compiles were still running after 60 s of typing').toBe(false) |
599 | 612 | expect(r.compileError ?? null).toBeNull() |
600 | 613 | // Only keys pressed while a compile ran count: that leaves out the warm-up, the gaps between |
|
0 commit comments