Skip to content

Commit

Permalink
test: use setImmediate() in test of stream2
Browse files Browse the repository at this point in the history
use setImmediate() insted of setTimeout()
 in test of stream2 push.
The test is in test/parallel/test-stream2-push.js

Fixes: nodejs/code-and-learn#58
PR-URL: #9583
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
  • Loading branch information
mganeko authored and addaleax committed Nov 22, 2016
1 parent 474d4aa commit 51e24e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-stream2-push.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function end() {
source.emit('end');
assert(!reading);
writer.end(stream.read());
setTimeout(function() {
setImmediate(function() {
assert(ended);
});
}

0 comments on commit 51e24e7

Please sign in to comment.