docs(code-runtime-python): drop the placebo dispose test and finish the remaining doc drift

The review showed the added dispose case was a placebo (dispose in the same
tick as run means SIGTERM hits the group before the program body runs; the
group-emptied arm is already deterministically covered by the same-group
survivor case, which this removes the v8 ignore for). The test is deleted; the
stale silently-discards comment in the boundary test now says rejects; the
README Known Limitations gains the late-log-frame-drop and host-side
binding-value-memory entries. Pairing re-recorded.
This commit is contained in:
Chinesezjc
2026-08-31 15:02:38 +08:00
committed by Tianyi Cui
parent bc08f405cc
commit 666ff2855e
4 changed files with 9 additions and 29 deletions
@@ -110,9 +110,9 @@ describe('PythonCodeRuntime — seam descriptors and misuse', () => {
// bytes, so a payload occupies at most `cap + envelope` on the wire; the
// bound is `parse-cap - envelope`, not `(ceiling - envelope) / 6` (that
// divided in escape expansion the charge already counts). The receive path
// drops raw frames past the 64 MiB parse cap before decoding, so a budget
// above it would admit a config whose honest child frames the host then
// silently discards.
// rejects raw frames past the 64 MiB parse cap (the run settles as a
// worker-exit), so a budget above it would admit a config whose honest
// child frames the host then rejects.
const admissible = 64 * 1024 * 1024 - 64
const ctx = new Context()
await expect(ctx.plugin(PythonCodeRuntime, { maxLogBytes: admissible + 1 }))
@@ -2952,30 +2952,6 @@ describe('PythonCodeRuntime — budgets, termination, disposal', () => {
expect(still).toBe(true)
}, 20_000)
it('dispose resolves promptly when the kill empties the group and an orphan holds the pipes', async () => {
// The group-emptied arm of the reap poll: dispose() drives settle, kill()
// kills the still-running child, and a setsid orphan holds the pipes open
// so close never fires — the poll must run, see the group empty (the
// orphan escaped into its own session), cancel the pending grace SIGKILL,
// and finalize immediately. A prompt resolve proves the arm ran
// (fail-before: dropping clearTimeout/finalize from that arm leaves dispose
// waiting for the never-firing grace escalation and blows the bound).
const { runtime, fiber } = await setup({ maxWallMs: 60_000, graceMs: 60_000 })
const start = Date.now()
const runPromise = runtime.run({
program: [
'import subprocess, sys, time',
'subprocess.Popen([sys.executable, "-c", "import time; time.sleep(30)"],',
' start_new_session=True)',
'time.sleep(30)',
].join('\n'),
bindings: [],
})
await fiber.dispose()
const result = await runPromise
expect(result.error?.kind).toBe('abort')
expect(Date.now() - start).toBeLessThan(5_000)
}, 20_000)
it('dispose awaits reaping of a same-group survivor from a completed run', async () => {
// The quiescence contract also holds for a run that ALREADY resolved: the run