-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
node sometimes hangs when NODE_V8_COVERAGE is set #1074
Comments
Thanks for this, one guess would be something to do with how we use native libraries using the N-API. I'd have to look up if there are practices required to make it work. Did you get into any analysis as to where the hang is happening? Does it happen outside of docker also? Also I'm assuming you can run the same instrumentation on a non-Pact project and it works as expected? |
I uncovered the hang on our Jenkins server running Amazon Linux 2. The tests run fine on macOS with NODE_V8_COVERAGE set. At first I thought it could be linux+limited RAM problem because This project defines 6 consumer interaction and 3 other tests. The hang does not manifest when only running the Pact interactions. We get valid coverage data when running the non-Pact tests. The tests define the Pact object even when the Pact tests are skipped if that maters. I was surprised I had iterate 100 times to get it to hang in the test script. |
FYI we ran into the same issue with Ava. I worked around it by patching ava to call |
i believe a fix had landed in node 20 that will resolve this and was backported to node 18 thanks @mhofman for tracking. |
Software versions
Issue Checklist
Please confirm the following:
Expected behavior
Node should not hang when generating coverage data while using pact.
Actual behavior
Depending on how many tests I run, node hangs when writing the coverage data.
Steps to reproduce
See the attached zip file,
test-pact-hang.zip, with a docker-compose.yml and Dockerfile that reproduce the problem. When you run
docker compose up --build
node hangs using 100% CPU and 7.2GB RAM. Node does not hang when NODE_V8_COVERAGE is not set in the docker-compose file. Uncommentingglobal.gc();
in test-pact.js prevents the hang when NODE_V8_COVERAGE is set.Relevant log files
See logs.txt in the zip file.
The text was updated successfully, but these errors were encountered: