Skip to content

Commit

Permalink
test: add known issue for fs.open() keeping event loop open
Browse files Browse the repository at this point in the history
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
Trott committed Jul 9, 2020
1 parent c08920b commit 6ae1b9c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/known_issues/known_issues.status
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ test-vm-timeout-escape-queuemicrotask: SKIP
# The Raspberry Pis are too slow to run this test.
# See https://github.com/nodejs/build/issues/2227#issuecomment-608334574
test-crypto-authenticated-stream: SKIP
# The bug being checked is that the test never exits.
test-fs-open-no-close: TIMEOUT
30 changes: 30 additions & 0 deletions test/known_issues/test-fs-open-no-close.js
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');
}

0 comments on commit 6ae1b9c

Please sign in to comment.