Skip to content

Commit 617aa2e

Browse files
authored
test: add env variable TEST_IGNORE_TIMEOUT_FAILURES to suppress timeout failures (#4543)
1 parent fdb98d2 commit 617aa2e

File tree

1 file changed

+13
-0
lines changed
  • packages/acceptance-tests/pkg-tests-core/sources/utils

1 file changed

+13
-0
lines changed

packages/acceptance-tests/pkg-tests-core/sources/utils/tests.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,19 @@ export const generatePkgDriver = ({
719719
};
720720

721721
try {
722+
// To pass [citgm](https://github.com/nodejs/citgm), we need to suppress timeout failures
723+
// So add env variable TEST_IGNORE_TIMEOUT_FAILURES to turn on this suppression
724+
if (process.env.TEST_IGNORE_TIMEOUT_FAILURES) {
725+
await Promise.race([
726+
new Promise(resolve => {
727+
// Maybe we should not hard code the timeout here
728+
// resolve 1s ahead the jest timeout
729+
setTimeout(resolve, 30000 - 1000);
730+
}),
731+
fn!({path, run, source}),
732+
]);
733+
return;
734+
}
722735
await fn!({path, run, source});
723736
} catch (error) {
724737
error.message = `Temporary fixture folder: ${npath.fromPortablePath(path)}\n\n${error.message}`;

0 commit comments

Comments
 (0)