Skip to content

Commit

Permalink
Skip flaky tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Nov 1, 2021
1 parent c4f6723 commit 0edfd00
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
5 changes: 3 additions & 2 deletions test-tap/api.js
Expand Up @@ -2,6 +2,7 @@ import fs from 'node:fs';
import path from 'node:path';
import {fileURLToPath} from 'node:url';

import ciInfo from 'ci-info';
import del from 'del';
import {test} from 'tap';

Expand Down Expand Up @@ -116,7 +117,7 @@ for (const opt of options) {
t.equal(runStatus.stats.failedTests, 1);
});
});
test(`fail-fast mode - workerThreads: ${opt.workerThreads} - multiple files & interrupt`, async t => {
test(`fail-fast mode - workerThreads: ${opt.workerThreads} - multiple files & interrupt`, {skip: ciInfo.isCI}, async t => {
const api = await apiCreator({
...opt,
failFast: true,
Expand Down Expand Up @@ -228,7 +229,7 @@ for (const opt of options) {
});
});

test(`fail-fast mode - workerThreads: ${opt.workerThreads} - timeout & serial`, async t => {
test(`fail-fast mode - workerThreads: ${opt.workerThreads} - timeout & serial`, {skip: ciInfo.isCI}, async t => {
const api = await apiCreator({
...opt,
failFast: true,
Expand Down
24 changes: 12 additions & 12 deletions test-tap/integration/assorted.js
Expand Up @@ -3,32 +3,32 @@ import fs from 'node:fs';
import path from 'node:path';
import {fileURLToPath} from 'node:url';

import ciInfo from 'ci-info';
import stripAnsi from 'strip-ansi';
import {test} from 'tap';

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

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

test('timeout', t => {
test('timeout', {skip: ciInfo.isCI}, t => {
execCli(['long-running.cjs', '-T', '1s'], (error, stdout) => {
t.ok(error);
t.match(stdout, /Timed out/);
t.end();
});
});

// FIXME: This test fails in CI, but not locally. Re-enable at some point…
// test('interrupt', t => {
// const proc = execCli(['long-running.cjs'], (_, stdout) => {
// t.match(stdout, /SIGINT/);
// t.end();
// });
//
// setTimeout(() => {
// proc.kill('SIGINT');
// }, 2000);
// });
test('interrupt', {skip: ciInfo.isCI}, t => {
const proc = execCli(['long-running.cjs'], (_, stdout) => {
t.match(stdout, /SIGINT/);
t.end();
});

setTimeout(() => {
proc.kill('SIGINT');
}, 2000);
});

test('include anonymous functions in error reports', t => {
execCli('error-in-anonymous-function.cjs', (error, stdout) => {
Expand Down
3 changes: 2 additions & 1 deletion test-tap/test.js
@@ -1,6 +1,7 @@
import path from 'node:path';
import {fileURLToPath} from 'node:url';

import ciInfo from 'ci-info';
import delay from 'delay';
import sinon from 'sinon';
import {test} from 'tap';
Expand Down Expand Up @@ -569,7 +570,7 @@ test('timeout with promise', t => ava(a => {
t.match(result.error.message, /timeout/);
}));

test('timeout is refreshed on assert', t => ava(async a => {
test('timeout is refreshed on assert', {skip: ciInfo.isCI}, t => ava(async a => {
a.timeout(100);
a.plan(3);
await Promise.all([
Expand Down

0 comments on commit 0edfd00

Please sign in to comment.