dorny / test-reporter

Displays test results from popular testing frameworks directly in GitHub
MIT License
826 stars 207 forks source link

RangeError: Maximum call stack size exceeded #249

Open sruehl opened 1 year ago

sruehl commented 1 year ago

When running on macos or ubuntu we get a RangeError: Maximum call stack size exceeded. On windows it seems to be fine.

We use following definition:

  - name: Test Report
    uses: dorny/test-reporter@v1
    # TODO: apparently the reporter only works on windows
    if: (success() || failure()) && matrix.os == 'windows-latest'
    with:
      name: "Java Tests (OS: ${{ matrix.os }}, Java: ${{ matrix.java }})"
      path: '**/(surefire|failsafe)-reports/TEST-*.xml'
      reporter: java-junit

Is it the glob pattern which throws that error or is it that the reporter just can't parse those outputs?

https://github.com/apache/plc4x/actions/runs/5154522011

damageboy commented 1 year ago

Hey, just found this issue and I am also experiencing this with a recent increase in the size of the junit .xml I'm generating inside a GH action workflow. The previous report suggested that perhaps:

Is it the glob pattern which throws that error or is it that the reporter just can't parse those outputs?

However, in my case the number of generated junit XML files is constant and only their contents/size has changed.

If there is a code area that I can be pointed to I could try and fix this myself...

lauxjpn commented 1 year ago

We hit the same issue with our test suite (over 20,000 tests, run in a matrix that generates 8 jobs) when publishing. To workaround this issue, we use the following step in our workflow .yml file to change the stack size used by node:

[...]
jobs:
  Report:
    runs-on: ubuntu-latest
    steps:
      - name: 'Add default settings to node calls'
        shell: bash
        run: |
          #
          # The later used dorny/test-reporter@v1 action can throw the following exception when enough tests have been
          # executed:
          #     RangeError: Maximum call stack size exceeded
          #
          # We explicitly increase the max. stack size here to workaround this issue.
          #

          which node
          node --version

          mv /usr/local/bin/node /usr/local/bin/node_org
          echo '#!/bin/bash' >> /usr/local/bin/node
          echo '/usr/local/bin/node_org --stack-size=2048 $@' >> /usr/local/bin/node
          cat /usr/local/bin/node
          chmod +x /usr/local/bin/node
      - name: 'Publish Test Report'
        uses: dorny/test-reporter@v1
        env:
          NODE_OPTIONS: --max-old-space-size=4096
[...]

Later, we also hit the default heap limit with FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory, which we fixed by adding the --max-old-space-size=4096 option as well.