Skip to content

Commit

Permalink
Further improve test resiliency on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks committed Jan 28, 2025
1 parent da993f3 commit a343980
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/test/failures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,14 +529,25 @@ test(
failer.nextInvocation(),
]);
if ('code' in exitOrInvocation) {
finalExit = exitOrInvocation;
break;
if (exitOrInvocation.stderr.includes('EPERM')) {
// See note about EPERM above, it can also happen within wireit.
await new Promise((resolve) => setTimeout(resolve, 1000));
continue;
} else {
finalExit = exitOrInvocation;
break;
}
}
await rig.write('output', '1');
exitOrInvocation.exit(0);
finalExit = await wireit.exit;
if (finalExit.code !== 0) {
break;
if (finalExit.stderr.includes('EPERM')) {
// See note about EPERM above, it can also happen within wireit.
await new Promise((resolve) => setTimeout(resolve, 1000));
} else {
break;
}
}
}
} finally {
Expand Down Expand Up @@ -599,7 +610,12 @@ test(
failerInv.exit(0);
finalExit = await wireit.exit;
if (finalExit.code !== 0) {
break;
if (finalExit.stderr.includes('EPERM')) {
// See note about EPERM above, it can also happen within wireit.
await new Promise((resolve) => setTimeout(resolve, 1000));
} else {
break;
}
}
}
} finally {
Expand Down

0 comments on commit a343980

Please sign in to comment.