From fc1e8a2beb6f1d501160ddd65d572d54075c54f3 Mon Sep 17 00:00:00 2001 From: m4air Date: Sun, 13 Sep 2026 20:03:57 -0700 Subject: [PATCH] test(crash-reporting): unpin the process-gone details from the CI host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit buildProcessGoneCrashDetails spreads getSystemMemoryDetails, which now reaches the real cgroup and PSI files. On ubuntu-latest — where the unit shards run — "flags a renderer-gone record whose live metrics carry only survivors" asserts an exact object and gains thirteen systemMemoryCgroup* / systemMemoryStall* keys plus a PressureSignal, so it fails on CI while passing on macOS. Proven by pointing the mount and procfs constants at a fake cgroup tree and relaxing the platform guards. pre-gone-host-memory.test.ts already stubs both readers for this reason; this is the same stub in the one other file that builds the details. --- src/main/crash-reporting/process-gone-diagnostics.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/crash-reporting/process-gone-diagnostics.test.ts b/src/main/crash-reporting/process-gone-diagnostics.test.ts index 6a6ec410733..53cedf6e7e4 100644 --- a/src/main/crash-reporting/process-gone-diagnostics.test.ts +++ b/src/main/crash-reporting/process-gone-diagnostics.test.ts @@ -7,6 +7,8 @@ import { startPreGoneCrashSampling } from './process-gone-diagnostics' import { setSystemMemoryInfoReaderForTest } from './system-memory-details' +import { setLinuxCgroupMemoryLimitReaderForTest } from './linux-cgroup-memory-limit' +import { setLinuxMemoryPressureStallReaderForTest } from './linux-memory-pressure-stall' type MetricFixture = { pid?: number @@ -29,10 +31,16 @@ describe('process gone diagnostics', () => { beforeEach(() => { resetPreGoneCrashSamplingForTest() setSystemMemoryInfoReaderForTest(null) + // buildProcessGoneCrashDetails spreads getSystemMemoryDetails, so on a Linux + // runner the real cgroup and PSI files add keys to the exact-shape assertions. + setLinuxCgroupMemoryLimitReaderForTest(() => undefined) + setLinuxMemoryPressureStallReaderForTest(() => undefined) }) afterEach(() => { vi.useRealTimers() + setLinuxCgroupMemoryLimitReaderForTest(null) + setLinuxMemoryPressureStallReaderForTest(null) }) it('summarizes Electron process memory by crash-report-friendly buckets', () => {