Skip to content

Commit 452e413

Browse files
committed
fixup! crypto: add FIPS indicator diagnostics channel
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
1 parent 2a3fa01 commit 452e413

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

test/parallel/test-diagnostics-channel-crypto-fips-indicator.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ if (!common.hasCrypto) {
77
}
88

99
const assert = require('node:assert');
10-
const { spawnSync } = require('node:child_process');
1110
const diagnosticsChannel = require('node:diagnostics_channel');
1211
const { once } = require('node:events');
1312
const { Worker } = require('node:worker_threads');
13+
const {
14+
spawnSyncAndExitWithoutError,
15+
} = require('../common/child_process');
1416
const { hasFIPS, hasOpenSSL } = require('../common/crypto');
1517
const {
1618
createHmac,
@@ -26,14 +28,10 @@ if (!hasOpenSSL(3, 4)) {
2628
} else if (!hasFIPS(3, 4)) {
2729
common.skip('an active OpenSSL 3.4+ FIPS provider is required');
2830
} else if (!process.execArgv.includes('--enable-fips-indicator-events')) {
29-
const child = spawnSync(
31+
spawnSyncAndExitWithoutError(
3032
process.execPath,
3133
['--enable-fips-indicator-events', __filename],
32-
{ encoding: 'utf8' });
33-
assert.strictEqual(
34-
child.status,
35-
0,
36-
`stdout: ${child.stdout}\nstderr: ${child.stderr}`);
34+
);
3735
} else {
3836
run().then(common.mustCall());
3937
}
@@ -56,11 +54,8 @@ function nextIndicator() {
5654
}
5755

5856
function testUnsubscribeDuringDrain(key, privateKey) {
59-
let resolve;
6057
const keepAlive = setInterval(common.mustNotCall(), 10_000);
61-
const promise = new Promise((fulfill) => {
62-
resolve = fulfill;
63-
});
58+
const { promise, resolve } = Promise.withResolvers();
6459
const subscriber = common.mustCall(() => {
6560
clearInterval(keepAlive);
6661
assert.strictEqual(

0 commit comments

Comments
 (0)