cenfun / monocart-coverage-reports

A code coverage tool to generate native V8 reports or Istanbul reports.
MIT License
31 stars 5 forks source link

Performance issue 47 #49

Closed cenfun closed 2 months ago

mrazauskas commented 2 months ago

@cenfun After this change I am getting OOM on macOS in CI. Reference: https://github.com/tstyche/tstyche/actions/runs/9731886196/job/26857943053#step:7:1

That script is generating console-details and raw reports. Works fine on Windows and Ubuntu, but not on macOS anymore. Very strange.

cenfun commented 2 months ago

That is weird. and I don't have the macOS to test it.

cenfun commented 2 months ago

@mrazauskas I guess it should be caused by Promise.all because I found there are so many coverage files in coverage\v8-coverage https://github.com/cenfun/monocart-coverage-reports/blob/main/lib/generate.js#L919

cenfun commented 2 months ago

@mrazauskas The latest version caches some data to memory for performance improvement, which may cause OOM. You can try the env options: NODE_OPTIONS: --max-old-space-size=8192 (maybe 4096 is enough)

- run: yarn test:coverage
        env:
          FORCE_COLOR: true
          MCR_LOG_TIME: true
          NODE_OPTIONS: --max-old-space-size=8192

it is passed on macOS, see https://github.com/cenfun/monocart-coverage-reports/actions/runs/9732874349/job/26859088535

mrazauskas commented 2 months ago

Yes! This does the job. Thanks for taking time.