tape: "test exited without ending"
Hi!
Probabilistically, I get the following:
not ok 95 test exited without ending
---
operator: fail
...
not ok 96 test exited without ending
---
operator: fail
...
(more of the same)
operator: fail
...
not ok 112 test exited without ending
---
operator: fail
...
not ok 113 test exited without ending
---
operator: fail
...
1..113
# tests 113
# pass 94
# fail 19
19 out of 20 runs are OK. I am mostly annoyed by the fact I can not localize/attribute the error.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 65 (11 by maintainers)
Commits related to this issue
- chore: use isaac's node-tap substack's tape had strange intermittent issues https://github.com/substack/tape/issues/223 — committed to gritzko/swarm by gritzko 9 years ago
- Use t.plan() rather than t.end() due to https://github.com/substack/tape/issues/223 — committed to kgryte/utils-copy-error by kgryte 9 years ago
- Wrap glob in quotes to prevent bash expansion, as suggested by @raynos https://github.com/substack/tape/issues/223#issuecomment-167920577 — committed to kgryte/utils-copy-error by kgryte 9 years ago
- Surround glob with quotes to prevent bash expansion (see https://github.com/substack/tape/issues/223) and add testling-proxyquire template — committed to kgryte/makefile by kgryte 9 years ago
- Wrap glob in quotes to prevent bash expansion due to https://github.com/substack/tape/issues/223 — committed to kgryte/package-json by kgryte 9 years ago
- Temporary bug fix for tape sporadic errors - see https://github.com/substack/tape/issues/223 — committed to mongo-js/mongojs by saintedlama 8 years ago
- Use tape patch when running tests over multiple files (see substack/tape/issues/223) — committed to stdlib-js/stdlib by kgryte 8 years ago
- v4.7.0 - [Fix] fix spurious "test exited without ending" (#223) - [New] show full error stack on failure (#330) - [Deps] update `resolve`, `object-inspect`, `glob` - [Dev Deps] update `tap`, `co... — committed to tape-testing/tape by ljharb 7 years ago
- Temporary bug fix for tape sporadic errors - see https://github.com/substack/tape/issues/223 — committed to kronooss/mongojs by kronooss 8 years ago
I just tried to write a lengthy explanation and found you correct and myself incorrect, @simonhac. I was actually defending
tap’s behavior, nottape’s behavior. (I stopped usingtapea while ago.)taphangs until the test completes, which I find more reasonable, since you never know if a SIGINT or something is supposed to fire out of the blue to complete the test. It also ensures that tests run sequentially, should each be setting up and tearing down the same database or directory – no test is done, no subsequent test is run, until the plan count is reached orend()is called.I’m now siding with you, @simonhac. This appears to be another artifact of
tape’s attempt to support a test runner that can run multiple test files simultaneously. (Thetapecommand can complete running a test suite before all the tests have run, because the program will exit if all loaded tests have finished, even if all test files have not yet been loaded.)Nice plug there @jtlapp 😃 I’ll watch
subtapalso. Thanks.Ok, so I gave
tapa try. When running my tests usingtapit reported errors in my tests I had not seen before. After fixing those errors the tests all ran perfectly. I switched back totapeand got the same error as before: ‘test exited without ending’.For now I am going to switch to using
tap.Thanks @jtlapp for the suggestion.
Keep up the good work here guys. I’ll keep watching it.
@kgryte Could you try with
github:kl0tl/tape#fix/globbyinstead oftape? It should work if @Raynos is right. I’ll open a PR if this fixes the issue.This means your test did not call
assert.end().Probably a race condition in your own code.
Close! This did the trick:
So… should that be a PR? I don’t know what else that might affect. Tape’s tests still pass after that change, though.
thanks @jtlapp – i don’t understand why options 2 & 3 are not possible. at least with option 3, couldn’t
tapedetect that it has already exited and print out an explanation for failing the async’ly scheduled test?the current behaviour feels obscure for someone not into the implementation details.
@jtlapp
tapalso doesn’t work in browsers, which is part of whytapewas originally created.This does sound like a bug given the following conditions:
tapebinary and the globsLooks the race condition is here: https://github.com/substack/tape/blob/master/bin/tape#L28-L34
We really should “resolve” all globs in parallel; and then loop over ALL the files once instead of doing multiple loops.
As a temporary workaround @kgryte can do
tape "./test/*.js". By wrapping the expression in quotes bash wont expand them to all of the files.The tests are of the variety:
In the last file which occasionally fails, I added additional (synchronous) dummy test cases to see what happens. The result is that either all tests pass or all fail due to the
test exited without endingerror.