Skip to content

Commit 0edfd00

Browse files
committed
Skip flaky tests in CI
1 parent c4f6723 commit 0edfd00

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

test-tap/api.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import fs from 'node:fs';
22
import path from 'node:path';
33
import {fileURLToPath} from 'node:url';
44

5+
import ciInfo from 'ci-info';
56
import del from 'del';
67
import {test} from 'tap';
78

@@ -116,7 +117,7 @@ for (const opt of options) {
116117
t.equal(runStatus.stats.failedTests, 1);
117118
});
118119
});
119-
test(`fail-fast mode - workerThreads: ${opt.workerThreads} - multiple files & interrupt`, async t => {
120+
test(`fail-fast mode - workerThreads: ${opt.workerThreads} - multiple files & interrupt`, {skip: ciInfo.isCI}, async t => {
120121
const api = await apiCreator({
121122
...opt,
122123
failFast: true,
@@ -228,7 +229,7 @@ for (const opt of options) {
228229
});
229230
});
230231

231-
test(`fail-fast mode - workerThreads: ${opt.workerThreads} - timeout & serial`, async t => {
232+
test(`fail-fast mode - workerThreads: ${opt.workerThreads} - timeout & serial`, {skip: ciInfo.isCI}, async t => {
232233
const api = await apiCreator({
233234
...opt,
234235
failFast: true,

test-tap/integration/assorted.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@ import fs from 'node:fs';
33
import path from 'node:path';
44
import {fileURLToPath} from 'node:url';
55

6+
import ciInfo from 'ci-info';
67
import stripAnsi from 'strip-ansi';
78
import {test} from 'tap';
89

910
import {execCli} from '../helper/cli.js';
1011

1112
const __dirname = fileURLToPath(new URL('.', import.meta.url));
1213

13-
test('timeout', t => {
14+
test('timeout', {skip: ciInfo.isCI}, t => {
1415
execCli(['long-running.cjs', '-T', '1s'], (error, stdout) => {
1516
t.ok(error);
1617
t.match(stdout, /Timed out/);
1718
t.end();
1819
});
1920
});
2021

21-
// FIXME: This test fails in CI, but not locally. Re-enable at some point…
22-
// test('interrupt', t => {
23-
// const proc = execCli(['long-running.cjs'], (_, stdout) => {
24-
// t.match(stdout, /SIGINT/);
25-
// t.end();
26-
// });
27-
//
28-
// setTimeout(() => {
29-
// proc.kill('SIGINT');
30-
// }, 2000);
31-
// });
22+
test('interrupt', {skip: ciInfo.isCI}, t => {
23+
const proc = execCli(['long-running.cjs'], (_, stdout) => {
24+
t.match(stdout, /SIGINT/);
25+
t.end();
26+
});
27+
28+
setTimeout(() => {
29+
proc.kill('SIGINT');
30+
}, 2000);
31+
});
3232

3333
test('include anonymous functions in error reports', t => {
3434
execCli('error-in-anonymous-function.cjs', (error, stdout) => {

test-tap/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from 'node:path';
22
import {fileURLToPath} from 'node:url';
33

4+
import ciInfo from 'ci-info';
45
import delay from 'delay';
56
import sinon from 'sinon';
67
import {test} from 'tap';
@@ -569,7 +570,7 @@ test('timeout with promise', t => ava(a => {
569570
t.match(result.error.message, /timeout/);
570571
}));
571572

572-
test('timeout is refreshed on assert', t => ava(async a => {
573+
test('timeout is refreshed on assert', {skip: ciInfo.isCI}, t => ava(async a => {
573574
a.timeout(100);
574575
a.plan(3);
575576
await Promise.all([

0 commit comments

Comments
 (0)