ctrf-io / ctrf-io/github-test-reporter
Excessive memory usage when processing history leads to Javascript Heap Exhaustion
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 376
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Problem, we have a pretty large test suite in python with around 1250+ tests, and when we try to use the github-test-reporter action on main, we get:
Run ctrf-io/github-test-reporter@v1
📜 Preparing CTRF report
⏮️ Processing previous results
Starting workflow runs processing...
(node:402) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
<--- Last few GCs --->
[402:0x2ecac000] 100072 ms: Mark-Compact 4089.6 (4126.8) -> 4089.6 (4130.8) MB, pooled: 0 MB, 50.99 / 0.00 ms (average mu = 0.450, current mu = 0.031) allocation failure; scavenge might not succeed
[402:0x2ecac000] 100155 ms: Mark-Compact 4090.0 (4131.1) -> 4090.0 (4131.1) MB, pooled: 0 MB, 82.29 / 0.00 ms (average mu = 0.206, current mu = 0.005) allocation failure; scavenge might not succeed
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
Note that this is not a problem on branches and pr's it is exclusively a problem on the main branch.
I have tried limiting the length of the history from the default 10 to 2, but still the problem persists.
Config:
steps:
- uses: actions/checkout@v6
- name: Install pytest
run: pip3 install pytest pytest-json-ctrf pytest-cov pytest-xdist pytest-mock pyfakefs
shell: bash
- name: Test all workflows
id: run-pytest
run: |
pytest -n auto -m "not serial" --cov=scripts --cov-report=xml --ctrf ctrf-report.json
rm -f github-summary.env
shell: bash
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
if: always()
with:
report-path: 'ctrf-report.json'
summary-delta-report: true
insights-report: true
flaky-rate-report: true
upload-artifact: true
pull-request-report: true
overwrite-comment: true
previous-results-max: 2
comment-tag: PR Test Report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
When i run the test suite with json output enabled locally the resulting report produced is 60mb large vs 170kb for junit.
I guess this could help explain the data volumes, but it still seems excessive to use 4GB of ram to process 2x60 mb of json?
Relevant logs:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the github-test-reporter action's “Processing previous results” path and reproduce the failure with the supplied pytest/CTRF configuration, previous-results-max: 2, and 60 MB report. Compare memory use while processing history; done means main-branch reporting completes without JavaScript heap exhaustion under this workload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, node.js, typescript
- Domain
- ci-cd, performance, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100