1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

chore: disable part of test-fs-read-stream.js (#24085)

This commit is contained in:
Bartek Iwańczuk 2024-06-03 02:12:52 +01:00 committed by GitHub
parent f8fdaa082b
commit 754f21f0cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 22 deletions

View file

@ -72,6 +72,7 @@
"test-fs-mkdir.js",
"test-fs-open.js",
"test-fs-opendir.js",
"test-fs-read-stream.js",
"test-fs-rmdir-recursive.js",
"test-fs-write-file.js",
"test-fs-write.js",

View file

@ -197,30 +197,31 @@ assert.throws(
}));
}
if (!common.isWindows) {
// Verify that end works when start is not specified, and we do not try to
// use positioned reads. This makes sure that this keeps working for
// non-seekable file descriptors.
tmpdir.refresh();
const filename = `${tmpdir.path}/foo.pipe`;
const mkfifoResult = child_process.spawnSync('mkfifo', [filename]);
if (!mkfifoResult.error) {
child_process.exec(`echo "xyz foobar" > '${filename}'`);
const stream = new fs.createReadStream(filename, common.mustNotMutateObjectDeep({ end: 1 }));
stream.data = '';
// TODO(bartlomieju): this bit became very flaky on CI, and so far we haven't pinpointed the exact cause
// if (!common.isWindows) {
// // Verify that end works when start is not specified, and we do not try to
// // use positioned reads. This makes sure that this keeps working for
// // non-seekable file descriptors.
// tmpdir.refresh();
// const filename = `${tmpdir.path}/foo.pipe`;
// const mkfifoResult = child_process.spawnSync('mkfifo', [filename]);
// if (!mkfifoResult.error) {
// child_process.exec(`echo "xyz foobar" > '${filename}'`);
// const stream = new fs.createReadStream(filename, common.mustNotMutateObjectDeep({ end: 1 }));
// stream.data = '';
stream.on('data', function(chunk) {
stream.data += chunk;
});
// stream.on('data', function(chunk) {
// stream.data += chunk;
// });
stream.on('end', common.mustCall(function() {
assert.strictEqual(stream.data, 'xy');
fs.unlinkSync(filename);
}));
} else {
common.printSkipMessage('mkfifo not available');
}
}
// stream.on('end', common.mustCall(function() {
// assert.strictEqual(stream.data, 'xy');
// fs.unlinkSync(filename);
// }));
// } else {
// common.printSkipMessage('mkfifo not available');
// }
// }
{
// Pause and then resume immediately.