-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
"Empty" test files are ok on node@5 and not ok on node@4 #604
Comments
Oh. Totally sorry, I posted this issue too quickly. It's not especially related to "empty" files. Will try to investigate. |
What version of npm are you using on node 4 locally? Travis node 4 uses AVA should behave the same across environments, so I feel this is valid. |
Latest default node@4 ( |
I'm getting this error too but on 0.12. |
I edited those empty test file to use https://travis-ci.org/MoOx/statinamic/jobs/115137586#L794-L800 |
Btw, if you look correctly, it's not empty files that report failure (eg: src/configurator/tests/index.js do have tests). |
Those failure files contain : sync, async, and todo test. So I assume this happens randomly |
@MoOx @ben-eb @thangngoc89 could you try with |
@novemberborn thanks. I'm setting up a branch for this. |
@novemberborn Still failing, unfortunately. https://travis-ci.org/postcss/postcss-selector-parser/jobs/117308186 |
@novemberborn Sorry for the delay. We haven't run tests on node 4 for a while so there is some issues I had to be fixed first. But like @ben-eb said. it's still failing https://travis-ci.org/MoOx/statinamic/jobs/117313475#L889-L902 |
@ben-eb @thangngoc89 yes sorry I wasn't clear before. I was hoping the failures would at least be more consistent now. I'll try and have a closer look at this tomorrow. |
@novemberborn this bug is now appear on node 5 too. https://travis-ci.org/MoOx/statinamic/builds/117380398 I started to think that this is a concurrency problem since I can't re-produce this locally. Can we limit the concurrency here ? |
Not sure why but we currently are having issue with travis/push but not travis/pr, this is realllly weird... https://travis-ci.org/MoOx/statinamic/builds/117449079 vs https://travis-ci.org/MoOx/statinamic/builds/117449085 And this have nothing to do with empty file, since we are now using ava.todo() |
Yea that's my thinking too. Both the test suites have a large number of test files. Normally AVA will fail a test run if the child process exits with a non-zero exit code, but that's not happening here. When I reduce the memory the child processes exit with a $ node --max-executable-size=10 --max-old-space-size=15 --max-semi-space-size=1 node_modules/.bin/ava --verbose 'src/__tests__/*.js' There's a bunch more output that's not in the CI logs though:
Could you try with https://github.com/sindresorhus/ava/tree/sigabrt? It'll log the |
I ran the above command locally and got the process out of memory (node 5)
This is CI build with AVA from sigabrt branch |
|
Looks like there is a limit on the number of processes Travis will handle
Seems really likely this is the issue. It seems your test suites are able to handle a lot more than just four processes though. That document is targeted towards Ruby, so maybe Node processes are lighter weight and Travis can handle more. Throttling concurrency in AVA is likely to be non-trivial. The only solution I can think of for now is to batch via the cli: ava test/subdir1/*.js
ava test/subdir2/*.js
ava test/subdir3/*.js I get that that is really ugly. We will make fixing this a priority. |
Yea, the commands reduce the memory until that occurs. Big takeaway is that we're not catching these kinds of crashes, resulting in misleading log output. I'll do a PR soon to improve AVAs output in this case. Let's discuss the forking related issues in #78. Thanks all for pushing AVA to its limits! |
Do you have a good solution for running tests in batches with global code coverage using nyc? As far as I'm aware, running in batches will leave lines uncovered which would be hit in other test files... |
@ben-eb I guess you could write a wrapper script which launches a child process for each batch. nyc should be able to instrument that. Running your tests in serial may also help, assuming Travis only kills the processes once they start executing the tests, not while they're first launched. |
I think processes are getting killed before any tests start. The logs seem to show all the |
as of now its impossible to run coverage with AVA. The build keeps failing look avajs/ava#604 (comment)
as of now its impossible to run coverage with AVA. The build keeps failing look avajs/ava#604 (comment)
Just FYI, this script I wrote should be able to fix anyone's builds that are running into this error. It allows you to run AVA processes on each of your files serially, and supports code coverage. Note that it is slow, especially compared to running AVA on your local machine, so I recommend using an alternate script when not using Travis CI. |
@ben-eb can I steal your script ? |
Sorry if it wasn't clear, but yes anyone is free to take this script and use it under the terms of the MIT license. |
I improved @ben-eb a little bit. You can now choose how many main AVA processes you want to spawn. They will be run concurrency. https://github.com/MoOx/statinamic/blob/3eaf91f6d58fb76eab8236eebbd5b69625182076/scripts/ava-serial.js Does it looks like a concurrency implementation of AVA ? @jamestalmage @novemberborn |
@thangngoc89 - There are added inefficiencies (and reduced complexities) by not implementing in AVA. By all means - use this script until we "fix it the right way". |
I currently have a project with "empty" test files like this
By empty I mean that there is not a single assertion.
This is a workaround for
nyc --all
(see istanbuljs/nyc#181) to get a real coverage percentage with a project that is not fully tested (yet).Checkout this build https://travis-ci.org/MoOx/statinamic/builds/113959817. It's working on node@5 and failing on node@4 because empty test files report " Test results were not received from ...".
I expect that AVA behave the same on node@5 and node@4. So fails on both, or pass on both.
Maybe I am doing something wrong?
The text was updated successfully, but these errors were encountered: