avajs/ava

SIGSEGV with worker threads #3159

Zajozor posted onGitHub

  • What you're trying to do

I have a typescript project, I'm using tsc to precompile the files, then running ava on them. The generated js is commonJS. I wrote only a few tests so far and noticed that running with worker threads causes a SIGSEGV.


  • What happened
    ❯ yarn ava --config tests_ava/ava.config.js
    ...
    error Command failed with signal "SIGSEGV".

but when I do

❯ yarn ava --config tests_ava/ava.config.js --no-worker-threads
...
  3 tests passed
✨  Done in 1.91s.

  • What you expected to happen

I'd expect not to get a SIGSEGV when using worker threads.


ava.config.js:

module.exports = {
  files: ['tests_ava/**', '!tests_ava/ava.config.js'],
  typescript: {
    compile: 'tsc',
    rewritePaths: {
      '@common/': 'dist_test/common/src/',
    },
  },
  failFast: true,
  failWithoutAssertions: false,
}

I understand that the above is not a minimal reproducible example (MRE) as well as the fact that the issue is likely with some of the modules my project uses. But would you be so kind as to provide me with some guidance on what to look for, or how to produce an MRE? I'll happily spend more time digging into it, but I feel a bit lost right now.

  1. I specifically noticed that this happens when testing code which interacts with some native modules. Why would this problem not happen with separate processes as well?
  2. When the error happens, it looks like all tests pass, all output is written, and the SIGSEGV happens completely at the end, as if it was during some teardown procedure. Is that something I can use when trying to nail this down?
  3. The codebase is pretty big - several native and non-native modules - can you suggest something, eg. some node flags I could use to trace this down to a more specific culprit?

Thanks for your time :) !


Fund this Issue

$0.00
Funded

Pull requests