You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
platform: Linux ryan-S400CA 4.4.0-34-generic [streams] _flush not being called #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
subsystem: Readline, stream-handling
Observed Behaviour
readline.createInterface({input: process.stdin}) does not print each line and then emit the close event in a program designed to do this; instead it prints a random number of lines from stdin before exiting silently.
I'm unsure whether this is due to a misconception I have about the test-program, or whether this is a genuine bug. If any more information is needed, leave a comment and I'll respond quickly.
Expected Behaviour
readline should print each line from stdin, and then emit the close event.
Data
The program below tries to print each line of War and Peace (roughly 65,000 lines long), which it receives from stdin. When not printing, it always manages to emit the close event before exiting. When printing, the program exists prematurely after printing roughly 1900 lines.
throw new Error(JSON.stringify(counts))
^
Error: {"expected":65326,"actual":65325}
You will repeatedly see an error showing the entire file was read.
Replace
performTest(false)
with
performTest(true)
and rerun the test several times. The results should vary; on my machine it either prints out a line
~1900 lines into the file, or reaches the end of the file.
The text was updated successfully, but these errors were encountered:
I think this may have to do with writes to a tty being asynchronous in some cases. This was changed in ab3306a, which as of this writing hasn't been included in a release yet.
Observed Behaviour
readline.createInterface({input: process.stdin})
does not print each line and then emit the close event in a program designed to do this; instead it prints a random number of lines from stdin before exiting silently.I'm unsure whether this is due to a misconception I have about the test-program, or whether this is a genuine bug. If any more information is needed, leave a comment and I'll respond quickly.
Expected Behaviour
readline
should print each line from stdin, and then emit the close event.Data
The program below tries to print each line of War and Peace (roughly 65,000 lines long), which it receives from stdin. When not printing, it always manages to emit the close event before exiting. When printing, the program exists prematurely after printing roughly 1900 lines.
Test Proceedure
~/test-input.txt
~/test-program.js
:You will repeatedly see an error showing the entire file was read.
with
and rerun the test several times. The results should vary; on my machine it either prints out a line
~1900 lines into the file, or reaches the end of the file.
The text was updated successfully, but these errors were encountered: