Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to read to EOF on node v10 #29

Open
msimerson opened this issue Apr 8, 2019 · 1 comment
Open

fails to read to EOF on node v10 #29

msimerson opened this issue Apr 8, 2019 · 1 comment

Comments

@msimerson
Copy link
Owner

I added node v10 testing on Travis. On versions of Node < 10, test results are happy like this (with some additional debugging output):

reader
	readLine from test.log: The rain in spain falls mainly on the plain.
    ✓ reads a text file
	readLine from test.log: null
	readLine from test.log.1: The rain in spain falls mainly on the plain.
	readLine from test.log.1: The rain in spain falls mainly on the plain.
	readLine from test.log.1: The rain in spain falls mainly on the plain.
    ✓ reads another text file concurrently
	readLine from test.log.1: null
	readLine from batch.log: The rain in spain falls mainly on the plain.
	readLine from batch.log: The rain in spain falls mainly on the plain.
	readLine from batch.log: The rain in spain falls mainly on the plain.
	readLine from batch.log: The rain in spain falls mainly on the plain.
	readLine from batch.log: The rain in spain falls mainly on the plain.
	readLine from batch.log: The rain in spain falls mainly on the plain.
	readLine from batch.log: The rain in spain falls mainly on the plain.
	readLine from batch.log: The rain in spain falls mainly on the plain.
	readLine from batch.log: The rain in spain falls mainly on the plain.
    ✓ reads batches of lines
	readLine from batch.log: null
	readLine from batch.log: null
	readLine from test.log.1: The rain in spain falls mainly on the plain.
	readLine from test.log.1: The rain in spain falls mainly on the plain.
	readLine from test.log.1: The rain in spain falls mainly on the plain.

On node.js 10, the output is sad:

  reader
	readLine from test.log: The rain in spain falls mainly on the plain.
    ✓ reads a text file
	readLine from test.log: null
	readLine from test.log.1: The rain in spain falls mainly on the plain.
	readLine from test.log.1: The rain in spain falls mainly on the plain.
    1) reads another text file concurrently
	readLine from batch.log: The rain in spain falls mainly on the plain.
	readLine from batch.log: The rain in spain falls mainly on the plain.
    2) reads batches of lines
	readLine from test.log.1: The rain in spain falls mainly on the plain.
	readLine from test.log.1: The rain in spain falls mainly on the plain.
    3) maintains an accurate line counter
	readLine from test.log.1.gz: The rain in spain falls mainly on the plain.
    ✓ reads a gzipped file
    - reads a bzip2 compressed file
	readLine from test.log: The rain in spain falls mainly on the plain.
	readLine from test.log: null
    ✓ emits a drain when batch is full
...
1) reader
       reads another text file concurrently:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/msimerson/safe-log-reader/test/reader.js)
  
  2) reader
       reads batches of lines:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/msimerson/safe-log-reader/test/reader.js)
  
  3) reader
       maintains an accurate line counter:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/msimerson/safe-log-reader/test/reader.js)

The file test.log.1 has exactly 3 lines. You can see in node 4, 6, and 8 that 3 read events are emitted with the 3 lines and then an EOF. On node 10, the 3rd line and EOF are never emitted.

@crayfishuk
Copy link

In Node 10, I've found that it never sends a line after the first...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants