Skip to content

Commit ec9b49a

Browse files
TrottMylesBorins
authored andcommitted
test: add known issue for fs.open() keeping event loop open
PR-URL: #34228 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
1 parent 38b3c2a commit ec9b49a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

test/known_issues/known_issues.status

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ test-vm-timeout-escape-queuemicrotask: SKIP
2727
# The Raspberry Pis are too slow to run this test.
2828
# See https://github.com/nodejs/build/issues/2227#issuecomment-608334574
2929
test-crypto-authenticated-stream: SKIP
30+
# The bug being checked is that the test never exits.
31+
test-fs-open-no-close: TIMEOUT
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
3+
// Failing to close a file should not keep the event loop open.
4+
5+
const common = require('../common');
6+
7+
// This issue only shows up on Raspberry Pi devices in our CI. When this test is
8+
// moved out of known_issues, this check can be removed, as the test should pass
9+
// on all platforms at that point.
10+
const assert = require('assert');
11+
if (process.arch !== 'arm' || process.config.variables.arm_version > 7) {
12+
assert.fail('This test is for Raspberry Pi devices in CI');
13+
}
14+
15+
const fs = require('fs');
16+
17+
const debuglog = (arg) => {
18+
console.log(new Date().toLocaleString(), arg);
19+
};
20+
21+
const tmpdir = require('../common/tmpdir');
22+
tmpdir.refresh();
23+
24+
{
25+
fs.open(`${tmpdir.path}/dummy`, 'wx+', common.mustCall((err, fd) => {
26+
debuglog('fs open() callback');
27+
assert.ifError(err);
28+
}));
29+
debuglog('waiting for callback');
30+
}

0 commit comments

Comments
 (0)