Ava: Set concurrency option to 1 when $TRAVIS = true

Created on 1 Oct 2016  路  10Comments  路  Source: avajs/ava

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: https://github.com/diegohaz/generator-rest/issues/11

question

Most helpful comment

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

All 10 comments

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?

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

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.

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

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.

I'm actually doing something similar to this: https://github.com/Mockgoose/Mockgoose/issues/3#issuecomment-241894985

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

In https://github.com/avajs/ava/issues/966, we're looking into setting a default concurrency. Right now it's unlimited.

Closing due to inactivity.

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

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!

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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

electerious picture electerious  路  3Comments

ehmicky picture ehmicky  路  4Comments

fregante picture fregante  路  3Comments

ivogabe picture ivogabe  路  5Comments

leegee picture leegee  路  4Comments