Skip to content

Commit

Permalink
Fix Node.js in CITGM (v18.x) (#1828)
Browse files Browse the repository at this point in the history
* Fix Node.js in CITGM (v18.x)

Signed-off-by: Matteo Collina <hello@matteocollina.com>

* fixup

Signed-off-by: Matteo Collina <hello@matteocollina.com>

---------

Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Oct 9, 2023
1 parent b48d346 commit a87f5c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/broken-pipe.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ if (process.platform === 'win32') {
process.exit(0)
}

if (process.env.CITGM) {
// This looks like a some form of limitations of the CITGM test runner
// or the HW/SW we run it on. This file can hang on Node.js v18.x.
// The failure does not reproduce locally or on our CI.
// Skipping it is the only way to keep pino in CITGM.
// https://github.com/nodejs/citgm/pull/1002#issuecomment-1751942988
t.skip('Skipping on Node.js core CITGM because it hangs on v18.x')
process.exit(0)
}

function test (file) {
file = join('fixtures', 'broken-pipe', file)
t.test(file, { parallel: true }, async ({ equal }) => {
Expand Down
5 changes: 5 additions & 0 deletions test/syncfalse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const { test } = require('tap')
const { fork } = require('child_process')
const writer = require('flush-write-stream')
const { once, getPathToNull } = require('./helper')
const { promisify } = require('util')

const sleep = promisify(setTimeout)

test('asynchronous logging', async ({ equal, teardown }) => {
const now = Date.now
Expand Down Expand Up @@ -48,6 +51,8 @@ test('asynchronous logging', async ({ equal, teardown }) => {
cb()
}))
await once(child, 'close')
// Wait for the last write to be flushed
await sleep(100)
equal(actual, expected)
equal(actual2.trim(), expected2)

Expand Down

0 comments on commit a87f5c3

Please sign in to comment.