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 MylesBorins committed Dec 21, 2016
1 parent 44b2bbe commit e5ebc4b
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 e5ebc4b

Please sign in to comment.