Skip to content

Commit 0b012e5

Browse files
edvardchenmerceyz
authored andcommitted
test: add env variable TEST_IGNORE_TIMEOUT_FAILURES to suppress timeout failures (#4543)
(cherry picked from commit 617aa2e)
1 parent 68a7f88 commit 0b012e5

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
@@ -741,6 +741,19 @@ export const generatePkgDriver = ({
741741
};
742742

743743
try {
744+
// To pass [citgm](https://github.com/nodejs/citgm), we need to suppress timeout failures
745+
// So add env variable TEST_IGNORE_TIMEOUT_FAILURES to turn on this suppression
746+
if (process.env.TEST_IGNORE_TIMEOUT_FAILURES) {
747+
await Promise.race([
748+
new Promise(resolve => {
749+
// Maybe we should not hard code the timeout here
750+
// resolve 1s ahead the jest timeout
751+
setTimeout(resolve, 30000 - 1000);
752+
}),
753+
fn!({path, run, source}),
754+
]);
755+
return;
756+
}
744757
await fn!({path, run, source});
745758
} catch (error) {
746759
error.message = `Temporary fixture folder: ${npath.fromPortablePath(path)}\n\n${error.message}`;

0 commit comments

Comments
 (0)