diff --git a/tests/fixtures/awf-runner.ts b/tests/fixtures/awf-runner.ts index 79e53181..4540ad2f 100644 --- a/tests/fixtures/awf-runner.ts +++ b/tests/fixtures/awf-runner.ts @@ -195,6 +195,19 @@ export class AwfRunner { throw error; } + // With reject: false, execa returns instead of throwing on timeout. + // Detect this case and return a proper timeout result. + if (result.timedOut) { + return { + exitCode: -1, + stdout: result.stdout || '', + stderr: result.stderr || '', + success: false, + timedOut: true, + workDir: this.extractWorkDir(result.stderr || ''), + }; + } + // Extract work directory from stderr logs const workDir = this.extractWorkDir(result.stderr || ''); @@ -389,6 +402,19 @@ export class AwfRunner { throw error; } + // With reject: false, execa returns instead of throwing on timeout. + // Detect this case and return a proper timeout result. + if (result.timedOut) { + return { + exitCode: -1, + stdout: result.stdout || '', + stderr: result.stderr || '', + success: false, + timedOut: true, + workDir: this.extractWorkDir(result.stderr || ''), + }; + } + const workDir = this.extractWorkDir(result.stderr || ''); // Normalize exit code to handle undefined (defaults to 0) diff --git a/tests/integration/no-docker.test.ts b/tests/integration/no-docker.test.ts index 0a27f3d3..a4bb0b57 100644 --- a/tests/integration/no-docker.test.ts +++ b/tests/integration/no-docker.test.ts @@ -50,7 +50,7 @@ describe('Docker-in-Docker removal (PR #205)', () => { { allowDomains: ['github.com'], logLevel: 'debug', - timeout: 30000, + timeout: 120000, buildLocal: true, } ); @@ -63,7 +63,7 @@ describe('Docker-in-Docker removal (PR #205)', () => { const result = await runner.runWithSudo('docker run alpine echo hello', { allowDomains: ['github.com'], logLevel: 'debug', - timeout: 30000, + timeout: 120000, buildLocal: true, }); @@ -78,7 +78,7 @@ describe('Docker-in-Docker removal (PR #205)', () => { const result = await runner.runWithSudo('which docker-compose', { allowDomains: ['github.com'], logLevel: 'debug', - timeout: 30000, + timeout: 120000, buildLocal: true, }); @@ -93,7 +93,7 @@ describe('Docker-in-Docker removal (PR #205)', () => { { allowDomains: ['github.com'], logLevel: 'debug', - timeout: 30000, + timeout: 120000, buildLocal: true, } );