From 04aee12cc2adec697117d82fc7e9146a5c905bbc Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Mon, 31 Aug 2026 16:26:39 +0800 Subject: [PATCH] test(code-runtime-python): align macOS runtime expectations --- .../code-runtime-python/tests/runtime.spec.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/experimental/code-runtime-python/tests/runtime.spec.ts b/packages/experimental/code-runtime-python/tests/runtime.spec.ts index 7cf34ccb8f..8b88199bdd 100644 --- a/packages/experimental/code-runtime-python/tests/runtime.spec.ts +++ b/packages/experimental/code-runtime-python/tests/runtime.spec.ts @@ -539,7 +539,7 @@ describe('PythonCodeRuntime — seam descriptors and misuse', () => { const entry = await entryOf() expect(entry.endsWith('/bootstrap.py')).toBe(true) const dir = dirname(entry) - expect(dir.startsWith(realpathSync(tmpdir()))).toBe(true) + expect(dir.startsWith(tmpdir()) || dir.startsWith(realpathSync(tmpdir()))).toBe(true) expect(dir).not.toContain('/packages/') // Staging is per RUN and removed at settlement, so by the time `run()` // resolved the directory is already gone — nothing survives to be rewritten @@ -709,7 +709,8 @@ describe('PythonCodeRuntime — process identity', () => { }) describe('PythonCodeRuntime — inherited resource limits', () => { - it('runs under an inherited hard limit tighter than addressSpaceMb', async () => { + // Darwin deliberately does not apply RLIMIT_AS, and its shell rejects `ulimit -v`. + it.skipIf(process.platform === 'darwin')('runs under an inherited hard limit tighter than addressSpaceMb', async () => { // An unprivileged process may lower a hard rlimit but never raise it. Under // a harness started with `ulimit -v` below `addressSpaceBytes`, requesting // the configured cap made `setrlimit` raise `ValueError` and every run @@ -764,7 +765,8 @@ describe('PythonCodeRuntime — inherited resource limits', () => { } }, 15_000) - it('applies the configured limits when nothing tighter is inherited', async () => { + // The expected tuple includes RLIMIT_AS, which the backend deliberately skips on Darwin. + it.skipIf(process.platform === 'darwin')('applies the configured limits when nothing tighter is inherited', async () => { // The clamp must not weaken the normal path: with an infinite inherited hard // limit there is nothing to clamp against, and RLIM_INFINITY compares as -1, // so treating it as a numeric bound would collapse every limit to -1.