-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add known issue for fs.open() keeping event loop open
PR-URL: #34228 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Robert Nagy <ronagy@icloud.com>
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
// Failing to close a file should not keep the event loop open. | ||
|
||
const common = require('../common'); | ||
|
||
// This issue only shows up on Raspberry Pi devices in our CI. When this test is | ||
// moved out of known_issues, this check can be removed, as the test should pass | ||
// on all platforms at that point. | ||
const assert = require('assert'); | ||
if (process.arch !== 'arm' || process.config.variables.arm_version > 7) { | ||
assert.fail('This test is for Raspberry Pi devices in CI'); | ||
} | ||
|
||
const fs = require('fs'); | ||
|
||
const debuglog = (arg) => { | ||
console.log(new Date().toLocaleString(), arg); | ||
}; | ||
|
||
const tmpdir = require('../common/tmpdir'); | ||
tmpdir.refresh(); | ||
|
||
{ | ||
fs.open(`${tmpdir.path}/dummy`, 'wx+', common.mustCall((err, fd) => { | ||
debuglog('fs open() callback'); | ||
assert.ifError(err); | ||
})); | ||
debuglog('waiting for callback'); | ||
} |