mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
test(crash-reporting): unpin the process-gone details from the CI host
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.
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user