<#1074 node sometimes hangs when NODE_V8_COVERAGE ...
# pact-js-development
g
#1074 node sometimes hangs when NODE_V8_COVERAGE is set Issue created by jhayes-dev Software versions • OS: Amazon Linux 2 and node:gallium docker image • Consumer Pact library: pact@11.0.2 • Provider Pact library: _e.g. pact-jvm-provider-maven_2.11 v 3.3.8_ • Node Version: v16.19.1 Issue Checklist Please confirm the following: ☑︎ I have upgraded to the latest ☑︎ I have the read the FAQs in the Readme ☑︎ I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures ☑︎ I have set my log level to debug and attached a log file showing the complete request/response cycle ☐ For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem 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. Uncommenting
global.gc();
in test-pact.js prevents the hang when NODE_V8_COVERAGE is set. Relevant log files See logs.txt in the zip file. pact-foundation/pact-js