diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index 2ef676b40ae..286b183e044 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -6315,7 +6315,6 @@ "src/shared/execution-host-registry-shared-control-connect.test.ts": 160, "src/shared/execution-host-registry.test.ts": 169, "src/shared/execution-host.test.ts": 56, - "src/shared/external-automation-jobs-file.test.ts": 72, "src/shared/external-worktree-inbox.test.ts": 69, "src/shared/feature-education-telemetry.test.ts": 36, "src/shared/feature-tips.test.ts": 54, diff --git a/src/shared/external-automation-jobs-file.test.ts b/src/shared/external-automation-jobs-file.test.ts deleted file mode 100644 index a38e64d5a09..00000000000 --- a/src/shared/external-automation-jobs-file.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { mkdtemp, rm, truncate, writeFile } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, describe, expect, it } from 'vitest' -import { - EXTERNAL_AUTOMATION_JOBS_FILE_MAX_BYTES, - EXTERNAL_AUTOMATION_JOBS_MAX_ENTRIES, - readExternalAutomationJobsFile -} from './external-automation-jobs-file' - -const tempDirs: string[] = [] - -afterEach(async () => { - await Promise.all(tempDirs.splice(0).map((dir) => rm(dir, { recursive: true, force: true }))) -}) - -async function tempFile(name: string): Promise { - const dir = await mkdtemp(join(tmpdir(), 'orca-automation-jobs-')) - tempDirs.push(dir) - return join(dir, name) -} - -describe('readExternalAutomationJobsFile', () => { - it('rejects oversized sparse files with the explicit memory-limit error', async () => { - const path = await tempFile('oversized.json') - await writeFile(path, '') - await truncate(path, EXTERNAL_AUTOMATION_JOBS_FILE_MAX_BYTES + 64 * 1024 * 1024) - - await expect(readExternalAutomationJobsFile(path, { allowRootArray: true })).rejects.toThrow( - 'jobs file exceeds the 8 MiB memory limit' - ) - }) - - it('rejects excessive job counts explicitly', async () => { - const path = await tempFile('too-many.json') - await writeFile( - path, - JSON.stringify(Array.from({ length: EXTERNAL_AUTOMATION_JOBS_MAX_ENTRIES + 1 }, () => null)) - ) - - await expect(readExternalAutomationJobsFile(path, { allowRootArray: true })).rejects.toThrow( - 'more than 10,000 jobs' - ) - }) - - it('rejects structural amplification before parsing jobs', async () => { - const path = await tempFile('amplified.json') - await writeFile(path, '{"jobs":[{},{}]}') - - await expect( - readExternalAutomationJobsFile(path, { - allowRootArray: false, - structureLimits: { structuralTokens: 7, nestingDepth: 3 } - }) - ).rejects.toThrow('JSON structure') - }) -})