mafintosh / end-of-stream

Call a callback when a readable/writable/duplex stream has completed or failed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

end-of-stream@1.4.4 breaks `pumpify` tests in Node.js 10 and 12

Trott opened this issue · comments

$ npm install --no-package-lock
audited 82 packages in 0.675s
found 0 vulnerabilities

$ npm ls end-of-stream
pumpify@2.0.0 /Users/trott/pumpify
├─┬ duplexify@4.1.1
│ └── end-of-stream@1.4.4 
└─┬ pump@3.0.0
  └── end-of-stream@1.4.4  deduped

$ npm test

> pumpify@2.0.0 test /Users/trott/pumpify
> tape test.js

TAP version 13
# basic
ok 1 should be equivalent
ok 2 should be equivalent
ok 3 should be equivalent
# 3 times
ok 4 should be equivalent
ok 5 should be equivalent
ok 6 should be equivalent
ok 7 should be equivalent
# destroy
ok 8 should be truthy
# close
ok 9 should be equivalent
# end waits for last one
ok 10 should be truthy
ok 11 should be truthy
# always wait for finish
ok 12 should be truthy
# async
ok 13 should be equivalent
ok 14 should be equivalent
ok 15 should be equivalent
ok 16 should be equivalent
# early destroy
ok 17 should be truthy
# preserves error
ok 18 should be equivalent
# preserves error again
ok 19 should be truthy
ok 20 does not close with premature close
ok 21 should be truthy
ok 22 does not close with premature close
not ok 23 .end() called twice
  ---
    operator: fail
    at: Pumpify.<anonymous> (/Users/trott/pumpify/test.js:210:9)
    stack: |-
      Error: .end() called twice
          at Test.assert [as _assert] (/Users/trott/pumpify/node_modules/tape/lib/test.js:225:54)
          at Test.bound [as _assert] (/Users/trott/pumpify/node_modules/tape/lib/test.js:77:32)
          at Test.fail (/Users/trott/pumpify/node_modules/tape/lib/test.js:318:10)
          at Test.bound [as fail] (/Users/trott/pumpify/node_modules/tape/lib/test.js:77:32)
          at Test.end (/Users/trott/pumpify/node_modules/tape/lib/test.js:151:14)
          at Test.bound [as end] (/Users/trott/pumpify/node_modules/tape/lib/test.js:77:32)
          at Pumpify.<anonymous> (/Users/trott/pumpify/test.js:210:9)
          at Pumpify.emit (events.js:210:5)
          at Pumpify.Duplexify._destroy (/Users/trott/pumpify/node_modules/duplexify/index.js:195:15)
          at /Users/trott/pumpify/node_modules/duplexify/index.js:185:10
  ...
# returns error from duplexify
ok 24 should be equivalent

1..24
# tests 24
# pass  23
# fail  1

npm ERR! Test failed.  See above for more details.
$ node -v
v12.11.0
$ npm uninstall end-of-stream && npm install --no-save --no-package-lock end-of-stream@1.4.3
npm notice created a lockfile as package-lock.json. You should commit this file.
audited 82 packages in 0.59s
found 0 vulnerabilities

+ end-of-stream@1.4.3
updated 1 package and audited 82 packages in 0.683s
found 0 vulnerabilities

$ npm test

> pumpify@2.0.0 test /Users/trott/pumpify
> tape test.js

TAP version 13
# basic
ok 1 should be equivalent
ok 2 should be equivalent
ok 3 should be equivalent
# 3 times
ok 4 should be equivalent
ok 5 should be equivalent
ok 6 should be equivalent
ok 7 should be equivalent
# destroy
ok 8 should be truthy
# close
ok 9 should be equivalent
# end waits for last one
ok 10 should be truthy
ok 11 should be truthy
# always wait for finish
ok 12 should be truthy
# async
ok 13 should be equivalent
ok 14 should be equivalent
ok 15 should be equivalent
ok 16 should be equivalent
# early destroy
ok 17 should be truthy
# preserves error
ok 18 should be equivalent
# preserves error again
ok 19 should be truthy
ok 20 does not close with premature close
# returns error from duplexify
ok 21 should be equivalent

1..21
# tests 21
# pass  21

# ok
$ 

I get the same results with Node.js 10.x. The tests pass in Node.js 8.x.

Thanks @Trott , I’ll take a look. 1.4.4 is trying to work around a small implicit change in Node 10 that broke eos. Do you know if eos is part of CITGM?

This was a bug in the pumpify tests, which is fixed now.

Thanks @Trott , I’ll take a look. 1.4.4 is trying to work around a small implicit change in Node 10 that broke eos. Do you know if eos is part of CITGM?

eos is not currently in CITGM. You can see what modules are in CITGM at https://github.com/nodejs/citgm/blob/master/lib/lookup.json.

Thanks for fixing the pumpify issue! Any chance you can publish a 2.0.1 with it (even though it's just a test fix) so CITGM tests pass?

Released as 2.0.1, added a PR to add eos+pump