diff --git a/packages/code-runtime/code-runtime-python/src/index.ts b/packages/code-runtime/code-runtime-python/src/index.ts index 096a0da2c1..9ac5ffae5a 100644 --- a/packages/code-runtime/code-runtime-python/src/index.ts +++ b/packages/code-runtime/code-runtime-python/src/index.ts @@ -1402,6 +1402,9 @@ export class PythonCodeRuntime extends CodeRuntime { draining = true try { while (replyQueue.length > 0) { + // Needs the run to settle between two queued frames. Measured queue + // depths reach 11 without the wall clock landing inside that window. + /* v8 ignore next -- see above; not schedulable from a test. */ if (settled) break const payload = replyQueue.shift() as ReplyMessage // Encode inside the loop, not up front: a queued reply the run no diff --git a/packages/code-runtime/code-runtime-python/tests/runtime.spec.ts b/packages/code-runtime/code-runtime-python/tests/runtime.spec.ts index acb8a61ff3..8f24ff47c5 100644 --- a/packages/code-runtime/code-runtime-python/tests/runtime.spec.ts +++ b/packages/code-runtime/code-runtime-python/tests/runtime.spec.ts @@ -3892,6 +3892,7 @@ describe('PythonCodeRuntime — hostile peer', () => { expect(result.value).toBe(8 * chunk.length) }, 90_000) + it('bounds a flood of zero-byte log lines through the per-entry separator charge', async () => { // Blank print() lines carry zero content bytes; without the +1 separator // charge they would bypass maxLogBytes entirely and grow the retained