Skip to content

Commit ed3daf4

Browse files
jnsdlsclaude
andcommitted
fix: let the harness exit when its input closes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c97952b commit ed3daf4

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎harness/runner.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ for await (const line of lines) {
2020
}
2121
process.stdout.write(JSON.stringify(response) + '\n');
2222
}
23+
// Open database pools would otherwise keep the process alive once stdin closes.
24+
process.exit(0);

‎tests/harness.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ def call(self, op: str, **args: Any) -> Any:
4141
def close(self) -> None:
4242
if self._process.stdin is not None:
4343
self._process.stdin.close()
44-
self._process.wait(timeout=10)
44+
try:
45+
self._process.wait(timeout=10)
46+
except subprocess.TimeoutExpired:
47+
self._process.kill()
4548
self._log.close()

0 commit comments

Comments
 (0)