Skip to content

Commit ad69957

Browse files
committed
Simpler unit test timeouts
1 parent 326b647 commit ad69957

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

evals/apps/cli/src/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type TaskResult = { success: boolean; retry: boolean }
3737
type TaskPromise = Promise<TaskResult>
3838

3939
const MAX_CONCURRENCY = 20
40-
const TASK_TIMEOUT = 5 * 60 * 1_000
40+
const TASK_TIMEOUT = 10 * 60 * 1_000
4141
const UNIT_TEST_TIMEOUT = 60 * 1_000
4242

4343
const testCommands: Record<ExerciseLanguage, { commands: string[]; timeout?: number; cwd?: string }> = {
@@ -343,20 +343,17 @@ const runUnitTest = async ({ task }: { task: Task }) => {
343343
let passed = true
344344

345345
for (const command of commands) {
346-
const controller = new AbortController()
347-
const cancelSignal = controller.signal
348-
const timeout = setTimeout(() => controller.abort(), cmd.timeout ?? UNIT_TEST_TIMEOUT)
346+
const timeout = cmd.timeout ?? UNIT_TEST_TIMEOUT
349347

350348
try {
351-
const result = await execa({ cwd, shell: true, reject: false, cancelSignal })`${command}`
352-
clearTimeout(timeout)
349+
const result = await execa({ cwd, shell: true, reject: false, timeout })`${command}`
353350

354351
if (result.failed) {
355352
passed = false
356353
break
357354
}
358355
} catch (error) {
359-
console.log("[cli#runUnitTest] execa error =", error)
356+
console.log("[cli#runUnitTest]", error)
360357
passed = false
361358
break
362359
}

0 commit comments

Comments
 (0)