test(code-runtime-python): budget the wide-value walk for an instrumented lane

The O(depth) wide-value regression test ran under `maxWallMs: 20_000`, but the
cursor pulls 6M elements one at a time through Python-level frames: ~11s on an
idle machine, and more under the coverage lane's V8 instrumentation with several
workers sharing a runner. CI reported `timeout` instead of the round-trip.

Raise the run's ceiling to 60s inside a 90s vitest timeout, so the runtime's own
wall clock still fires first on a genuine hang. The assertion is unchanged and
still discriminates: restoring the O(width) `stack.extend` enqueue fails the test
with a child-side MemoryError in ~2.6s.
This commit is contained in:
Chinesezjc
2026-08-31 14:24:59 +08:00
committed by Tianyi Cui
parent bca73068f6
commit 86674ed21e
@@ -3701,12 +3701,19 @@ describe('PythonCodeRuntime — hostile peer', () => {
// frames plus the interpreter exceeded 384 MiB and returned MemoryError as an
// exception. Linux-only RLIMIT_AS repro; on macOS the value round-trips
// either way, but the fixture stays within the address space so it is honest.
const { runtime } = await setup({ maxValueBytes: 20 * 1024 * 1024, addressSpaceMb: 384, maxWallMs: 20_000 })
//
// `maxWallMs` is 60s, not the 20s the memory assertion alone needs: the O(depth)
// cursor pulls 6M elements one at a time through Python-level frames, which costs
// ~11s on an idle machine and more under the coverage lane's V8 instrumentation
// with several workers sharing a box. This budget bounds the run without letting a
// loaded runner's scheduling latency read as a `timeout` — what this test asserts
// is the O(depth) memory shape, not a speed claim.
const { runtime } = await setup({ maxValueBytes: 20 * 1024 * 1024, addressSpaceMb: 384, maxWallMs: 60_000 })
const result = await runtime.run({ program: 'return [0] * 6_000_000', bindings: [] })
expect(result.error).toBeUndefined()
expect(Array.isArray(result.value)).toBe(true)
expect((result.value as number[]).length).toBe(6_000_000)
}, 30_000)
}, 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