coverallsapp/github-action

Random error: `Error: Parallel webhook error:TypeError: Cannot read property 'done' of undefined, undefined`

mobilutz opened this issue · 5 comments

We are seeing this error randomly happening more today:

/home/runner/work/_actions/coverallsapp/github-action/master/lib/run.js:97
                        throw new Error('Parallel webhook error:' + err + ', ' + JSON.stringify(data));
                        ^

Error: Parallel webhook error:TypeError: Cannot read property 'done' of undefined, undefined
    at Request._callback (/home/runner/work/_actions/coverallsapp/github-action/master/lib/run.js:97:31)
    at Request.self.callback (/home/runner/work/_actions/coverallsapp/github-action/master/node_modules/request/request.js:185:22)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/runner/work/_actions/coverallsapp/github-action/master/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/runner/work/_actions/coverallsapp/github-action/master/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1184:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

Is there some error on coveralls app that might correlate?
The error is happening in the code_coverage run - see config below.

Out workflow file is as follows:

...
  backend_test:
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        # Set N number of parallel jobs you want to run tests on.
        # Use higher number if you have slow tests to split them on more parallel jobs.
        # Remember to update ci_node_index below to 0..N-1
        ci_node_total: [5]
        # set N-1 indexes for parallel jobs
        # When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc
        ci_node_index: [0, 1, 2, 3, 4]

    steps:
    ...
    - name: Run Rspec
      run: bundle exec parallel_test -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests'

    - name: Coveralls Parallel
      uses: coverallsapp/github-action@master
      continue-on-error: true
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        git-commit: ${{ github.event.pull_request.head.sha || github.sha }}
        flag-name: run-${{ matrix.ci_node_index }}-${{ github.run_id }}
        path-to-lcov: ${{ env.COVERAGE_LCOV_FILE_PATH }}
        parallel: true

  code_coverage:
    needs: backend_test
    runs-on: ubuntu-latest
    steps:
    - name: Coveralls Finished
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        git-commit: ${{ github.event.pull_request.head.sha || github.sha }}
        parallel-finished: true
...

I'm seeing the same error on our monorepo using the parallel flag.

Here is our workflow:

name: API CI tests
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  test_apps:
    strategy:
      matrix:
        app:
         -  [...]

    runs-on: ubuntu-latest
    name: Build & test
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Install dependencies
        id: install
        run: |
          cd ${{ matrix.app }} && npm ci

      - name: Run build
        id: build
        run: |
          cd ${{ matrix.app }} && npm run build

      - name: Use node v14.16.1
        uses: actions/setup-node@v1
        with:
          node-version: 14.16.1

      - name: Run tests
        id: test
        run: |
          cd ${{ matrix.app }} && npm run test

      - name: Report coverage
        uses: coverallsapp/github-action@1.1.3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          flag-name: test-${{ matrix.app }}
          path-to-lcov: ${{ matrix.app }}/coverage/lcov.info
          base-path: ${{ matrix.app }}
          parallel: true

  finish:
      name: Send Coverage
      needs: test_apps
      runs-on: ubuntu-latest
      steps:
      - name: Coveralls Finished
        uses: coverallsapp/github-action@1.1.3
        with:
          github-token: ${{ secrets.github_token }}
          parallel-finished: true

Edit: I tried coverallsapp/github-action@1.1.3 and coverallsapp/github-action@master. Both failed with the same error in the last step of the workflow.

The strange thing is, that even with this failure on the code_coverage step, everything is still working for us.
The different matrix-runs coverages are being reported and the overall coverage report also works.
Screen Shot 2021-08-30 at 15 06 16

I also encountered this problem a few days ago, but coveralls seems to be working fine now.