Files
orca/config/scripts/windows-process-tree-creation-time.test.mjs
T
OrcaWinandm4air 3a081abf71 fix(persistence): reclaim Windows profile locks after PID reuse (#23122)
* fix(persistence): identify reused Windows profile-owner processes

* fix(persistence): preserve absent-owner recovery without native registry

* ci: build Windows registry before native profile identity checks

* fix(cli): include native profile-owner dependencies in typecheck

* test: register native profile owner test in Windows PR lane

* test: use resilient Windows profile-owner cleanup

---------

Co-authored-by: m4air <m4air@m4airs-Air.localdomain>
2026-09-26 02:26:10 -07:00

38 lines
1.2 KiB
JavaScript

import { createRequire } from 'node:module'
import { expect, it } from 'vitest'
const { assertWindowsProcessTreeCreationTime } = createRequire(import.meta.url)(
'./windows-process-tree-creation-time.cjs'
)
it('rejects a previously patched binary that has table creation times but no synchronous getter', () => {
expect(() =>
assertWindowsProcessTreeCreationTime({
platform: 'win32',
module: { supportedProcessDataFlags: 7 }
})
).toThrow('synchronous identity getter')
})
it('accepts the compiled capability only when both readers are available', () => {
expect(() =>
assertWindowsProcessTreeCreationTime({
platform: 'win32',
module: { supportedProcessDataFlags: 7, getProcessCreationTime: () => undefined }
})
).not.toThrow()
})
it('still rejects a binary without table creation-time support', () => {
expect(() =>
assertWindowsProcessTreeCreationTime({
platform: 'win32',
module: { getProcessCreationTime: () => undefined }
})
).toThrow('CreationTime support')
})
it('does not require Windows native capabilities on another platform', () => {
expect(() => assertWindowsProcessTreeCreationTime({ platform: 'darwin' })).not.toThrow()
})