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

Set concurrency option to 1 when $TRAVIS = true #1060

Closed
diegohaz opened this issue Oct 1, 2016 · 10 comments
Closed

Set concurrency option to 1 when $TRAVIS = true #1060

diegohaz opened this issue Oct 1, 2016 · 10 comments
Labels

Comments

@diegohaz
Copy link

diegohaz commented Oct 1, 2016

It seems like Travis CI doesn't handle multiple processes. I'm currently using this npm script to run tests: "test": "[ \"$TRAVIS\" ] && c=1 || c=5; ava -c $c"

But it doesn't work on Windows. I'm looking for a cross-platform conditional statement solution, but I'm wondering if this condition should be made on AVA itself.

Reference: diegohaz/rest#11

@sindresorhus
Copy link
Member

I think that's specific to your tests. I use AVA with many projects and never experienced any problems with that. Did you figure it out?

@diegohaz
Copy link
Author

diegohaz commented Oct 3, 2016

Maybe. I'm using AVA with Mockgoose and for endpoint testing. Without concurrency option set to 1, I've experienced inconsistent errors like that: src/api/field/field.model.test.js exited due to SIGKILL.

I've read somewhere that Travis CI has a limit for multi processes, but I can't find it right now.

This is the output: https://travis-ci.org/diegohaz/generator-rest/jobs/159648372#L331-L346

@diegohaz
Copy link
Author

diegohaz commented Oct 3, 2016

I solved this by updating the travis.yml file (changing the script to npm test -- --serial). But the problem with multi processes is still an issue.

@sindresorhus
Copy link
Member

If I were to guess, copying the node_modules folder in so many processes exhausted the memory limit. See: https://docs.travis-ci.com/user/common-build-problems/#My-build-script-is-killed-without-any-error

@diegohaz
Copy link
Author

diegohaz commented Oct 3, 2016

I don't think so. I'm currently creating symlinks instead of copying node_modules. I'll investigate it more, but I would like to see more examples with database mocking like Mockgoose. Creating a MongoDB instance, with all necessary models and indexes for each test (or even test file) seems to be a huge task.

@diegohaz
Copy link
Author

diegohaz commented Oct 3, 2016

I'm actually doing something similar to this: Mockgoose/Mockgoose#3 (comment)

@sindresorhus
Copy link
Member

sindresorhus commented Oct 3, 2016

@diegohaz Does it also fail if you limit the concurrency to 5?

In #966, we're looking into setting a default concurrency. Right now it's unlimited.

@vadimdemedes
Copy link
Contributor

Closing due to inactivity.

@diegohaz feel free to reply back whenever you have time and we'll reopen the issue ;)

@Dakuan
Copy link

Dakuan commented Feb 11, 2017

I'm also having this issue on CircleCI...

my node_modules folder is 331mb, so you wouldn't need very many of them to trip up the server!

@darul75
Copy link

darul75 commented May 8, 2017

I confim having ava running tests with Travis in serial mode can fix that kind of issue

exited due to SIGKILL

Resolved with

ava --serial

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

No branches or pull requests

5 participants