Skip to content

Commit b696a78

Browse files
committed
In CITGM, skip tests that are flaky there (#3413)
Signed-off-by: Matteo Collina <hello@matteocollina.com>
1 parent 532b7b2 commit b696a78

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

test/connect-timeout.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ const { Client, Pool, errors } = require('..')
66
const net = require('node:net')
77
const assert = require('node:assert')
88

9+
const skip = !!process.env.CITGM
10+
911
// Using describe instead of test to avoid the timeout
10-
describe('prioritize socket errors over timeouts', async () => {
12+
describe('prioritize socket errors over timeouts', { skip }, async () => {
1113
const t = tspl({ ...assert, after: () => {} }, { plan: 1 })
1214
const client = new Pool('http://foorbar.invalid:1234', { connectTimeout: 1 })
1315

@@ -29,7 +31,7 @@ net.connect = function (options) {
2931
return new net.Socket(options)
3032
}
3133

32-
test('connect-timeout', async t => {
34+
test('connect-timeout', { skip }, async t => {
3335
t = tspl(t, { plan: 1 })
3436

3537
const client = new Client('http://localhost:9000', {
@@ -52,7 +54,7 @@ test('connect-timeout', async t => {
5254
await t.completed
5355
})
5456

55-
test('connect-timeout', async t => {
57+
test('connect-timeout', { skip }, async t => {
5658
t = tspl(t, { plan: 1 })
5759

5860
const client = new Pool('http://localhost:9000', {

test/node-test/debug.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ const { tspl } = require('@matteo.collina/tspl')
88
// eslint-disable-next-line no-control-regex
99
const removeEscapeColorsRE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g
1010

11-
test('debug#websocket', { skip: !process.versions.icu }, async t => {
11+
const isCITGM = !!process.env.CITGM
12+
13+
test('debug#websocket', { skip: !process.versions.icu || isCITGM }, async t => {
1214
const assert = tspl(t, { plan: 6 })
1315
const child = spawn(
1416
process.execPath,
@@ -44,7 +46,7 @@ test('debug#websocket', { skip: !process.versions.icu }, async t => {
4446
await assert.completed
4547
})
4648

47-
test('debug#fetch', async t => {
49+
test('debug#fetch', { skip: isCITGM }, async t => {
4850
const assert = tspl(t, { plan: 7 })
4951
const child = spawn(
5052
process.execPath,
@@ -78,7 +80,7 @@ test('debug#fetch', async t => {
7880
await assert.completed
7981
})
8082

81-
test('debug#undici', async t => {
83+
test('debug#undici', { skip: isCITGM }, async t => {
8284
// Due to Node.js webpage redirect
8385
const assert = tspl(t, { plan: 7 })
8486
const child = spawn(

0 commit comments

Comments
 (0)