mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-09 04:02:35 +00:00
fix(code-runtime-python): restore per-file branch coverage on the reap poll
The group-reap poll's deadline arm (Date.now() >= deadline) is a backstop that SIGKILL emptying the reachable group never reaches, leaving one uncovered branch under the per-file 100% gate. Mark it v8-ignore with the reason and drop the always-true graceTimer-defined guard inside pollGroup (it runs only when killing is set, so kill() has armed the timer).
This commit is contained in:
@@ -1082,8 +1082,15 @@ export class PythonCodeRuntime extends CodeRuntime {
|
||||
}
|
||||
const deadline = Date.now() + this.config.graceMs + CLOSE_REAP_MARGIN_MS
|
||||
const pollGroup = (): void => {
|
||||
// The deadline is a backstop: the group is reachable by `kill(-pid)`
|
||||
// and SIGKILL is uncatchable, so it always empties within graceMs — the
|
||||
// `Date.now() >= deadline` arm exists only so a probe that never sees
|
||||
// ESRCH (a kernel quirk) cannot hang disposal forever.
|
||||
/* v8 ignore next -- SIGKILL always empties the reachable group before the deadline. */
|
||||
if (groupEmpty() || Date.now() >= deadline) {
|
||||
if (graceTimer !== undefined) clearTimeout(graceTimer)
|
||||
// graceTimer is always defined here: pollGroup runs only when
|
||||
// `killing` is set, and kill() arms graceTimer before any settle.
|
||||
clearTimeout(graceTimer)
|
||||
finalize()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user