Skip to content

Commit 583b513

Browse files
committed
Document execArgv incompatibility with worker threads
1 parent 306e37c commit 583b513

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/08-common-pitfalls.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ test('fetches foo', async t => {
5454

5555
AVA [can't trace uncaught exceptions](https://github.com/avajs/ava/issues/214) back to the test that triggered them. Callback-taking functions may lead to uncaught exceptions that can then be hard to debug. Consider promisifying and using `async`/`await`, as in the above example. This should allow AVA to catch the exception and attribute it to the correct test.
5656

57+
## Node.js command line options, child processes and worker threads
58+
59+
By default AVA runs test files in worker threads. However, not all Node.js command line options (those that end up in [`process.execArgv`](https://nodejs.org/api/process.html#processexecargv)) are compatible with worker threads. You may get an error like this:
60+
61+
```
62+
Error [ERR_WORKER_INVALID_EXEC_ARGV]: Initiated Worker with invalid execArgv flags: --title
63+
```
64+
65+
If possible don't specify the command line option when running AVA. Alternatively you could [disable worker threads in AVA](./06-configuration.md#options).
66+
5767
## Sharing variables between asynchronous tests
5868

5969
By default AVA executes tests concurrently. This can cause problems if your tests are asynchronous and share variables.

0 commit comments

Comments
 (0)