Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tests/fixtures/awf-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment on lines +198 to +202
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 || '');

Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/no-docker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Docker-in-Docker removal (PR #205)', () => {
{
allowDomains: ['github.com'],
logLevel: 'debug',
timeout: 30000,
timeout: 120000,
buildLocal: true,
}
);
Expand All @@ -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,
});

Expand All @@ -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,
});

Expand All @@ -93,7 +93,7 @@ describe('Docker-in-Docker removal (PR #205)', () => {
{
allowDomains: ['github.com'],
logLevel: 'debug',
timeout: 30000,
timeout: 120000,
buildLocal: true,
}
);
Expand Down
Loading