Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e122d39

Browse filesBrowse files
Trottaddaleax
authored andcommitted
test: replace setTimeout with setImmediate in stream test
Replace setTimeout() with setImmediate() in test-stream-writable-clear-buffer. The test still fails in Node.js 8.6.0 (if you comment out the `common` module, since it uses BigInts and those aren't supported in 8.6.0). PR-URL: #30561 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 8ef629a commit e122d39
Copy full SHA for e122d39

File tree

Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Open diff view settings
Collapse file

‎test/sequential/test-stream-writable-clear-buffer.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-stream-writable-clear-buffer.js
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
const common = require('../common');
2+
require('../common');
33
const Stream = require('stream');
44
// This test ensures that the _writeableState.bufferedRequestCount and
55
// the actual buffered request count are the same
@@ -10,11 +10,12 @@ class StreamWritable extends Stream.Writable {
1010
super({ objectMode: true });
1111
}
1212

13-
// We need a timeout like on the original issue thread
14-
// otherwise the code will never reach our test case
15-
// this means this should go on the sequential folder.
13+
// Refs: https://github.com/nodejs/node/issues/6758
14+
// We need a timer like on the original issue thread.
15+
// Otherwise the code will never reach our test case.
16+
// This means this should go in the sequential folder.
1617
_write(chunk, encoding, cb) {
17-
setTimeout(cb, common.platformTimeout(10));
18+
setImmediate(cb);
1819
}
1920
}
2021

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.