also looking at this
test: retain execution lifetime failure observations
#62
10 files
+174
-64
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -118,7 +118,8 @@ elapsed deadlines, stream capacity, cleanup and durable COMMIT with a withheld | ||
| 118 | 118 | response. The existing workspace browser scenarios remain required regressions. |
| 119 | 119 | |
| 120 | 120 | The native lifetime fixture emits bounded phase observations around setup, |
| 121 | authority reads, retention waits and cleanup. Its parent records the observed | |
| 121 | authority reads, retention waits and cleanup. Parent-start and child-runtime | |
| 122 | records identify their Bun versions and executable paths independently. Its parent records the observed | |
| 122 | 123 | exit code and signal separately from whether its own watchdog fired or cleanup |
| 123 | 124 | requested a kill. The settled `exited` status is distinct from the raw |
| 124 | 125 | `exitCode` property, which can remain null after a signal. Elapsed time includes process work and output handling, not |
| @@ -4,6 +4,7 @@ import { setupExecutionLifetime } from './execution-lifetime-setup' | ||
| 4 | 4 | const mode = Bun.argv[2] |
| 5 | 5 | assert(mode === 'completed' || mode === 'canceled' || mode === 'quarantine') |
| 6 | 6 | const began = performance.now() |
| 7 | console.log(JSON.stringify({ oracle: 'lifetime-fixture-runtime', mode, bunVersion: Bun.version, executable: process.execPath, platform: process.platform, arch: process.arch })) | |
| 7 | 8 | let observations = 0 |
| 8 | 9 | async function observe<T>(phase: string, work: () => Promise<T>): Promise<T> { |
| 9 | 10 | const emit = (outcome: 'began' | 'settled' | 'rejected') => { |
| @@ -27,7 +27,7 @@ for (const mode of ['completed', 'canceled', 'quarantine']) test(`native executi | ||
| 27 | 27 | console.error('LIFETIME_FIXTURE_DEADLINE', JSON.stringify({ mode, pid: running.pid, timeoutMs: 90000, elapsedMs: performance.now() - began, requestedSignal: 'SIGKILL' })) |
| 28 | 28 | }, 90000) |
| 29 | 29 | try { |
| 30 | console.log(JSON.stringify({ oracle: 'lifetime-fixture-start', mode, pid: running.pid, timeoutMs: 90000 })) | |
| 30 | console.log(JSON.stringify({ oracle: 'lifetime-fixture-start', mode, pid: running.pid, timeoutMs: 90000, parentBunVersion: Bun.version, childExecutable: process.execPath })) | |
| 31 | 31 | const [code, stdout, stderr] = await Promise.all([exited, new Response(running.stdout).text(), new Response(running.stderr).text()]) |
| 32 | 32 | // eslint-disable-next-line no-console |
| 33 | 33 | for (const line of stdout.split('\n')) if (line.startsWith('{"oracle":')) console.log(line) |