microsoft / playwright-testing-service

MIT License
87 stars 13 forks source link

[BUG]: Rerunning a Playwright shard on a Pull Request in Github Actions results in a report that gets stuck in In Progress #137

Open angelo-loria opened 2 days ago

angelo-loria commented 2 days ago

When using the reporting dashboard with sharding in Github Actions, a re-run of a failed shard on a Pull Request results in a report that is stuck in In Progress.

To Reproduce Steps to reproduce the behavior:

  1. Execute tests in Github Actions with sharding enabled

    
    jobs:
    playwright_test:
    name: Playwright Test 
    strategy:
      fail-fast: false
      matrix:
        shardIndex: [1, 2, 3, 4, 5]
        shardTotal: [5]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
    
      - name: Yarn Install
        run: yarn install
    
      - name: Run Tests
        run: yarn test:ci --workers=2 --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
        env:
          # Access token and regional endpoint for Microsoft Playwright Testing
          PLAYWRIGHT_SERVICE_ACCESS_TOKEN: ${{ secrets.PLAYWRIGHT_SERVICE_ACCESS_TOKEN }}
          PLAYWRIGHT_SERVICE_URL: ${{ secrets.PLAYWRIGHT_SERVICE_URL }}
          PLAYWRIGHT_SERVICE_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} // note that this makes no difference


3. This is the result of our initial run:
![Image](https://github.com/user-attachments/assets/c9279c28-946f-48d6-a3ed-3998997d29b3)
4. The initial run results in a working report dashboard: 
![Image](https://github.com/user-attachments/assets/ee02cf96-3138-4b95-80a2-5b9c7928a7a0)
5. Rerun the failed jobs in Actions:
![Image](https://github.com/user-attachments/assets/92848204-3778-4514-abc8-9d63e55d5b3b)
6. After rerunning jobs, we have different results:
![Image](https://github.com/user-attachments/assets/0a82e41b-08ed-4715-b96b-dd984e9303a1)
7. The report gets stuck in In Progress and can't be accessed:
![Image](https://github.com/user-attachments/assets/13e53209-c26c-4a3c-b2c4-fd7419c5f9ad)

*Setup information (please complete the following information):**
 - Azure Subscription Id: af4ec0b8-998c-4cf2-900b-5352b121dbf9
 - Workspace Name: Kaleidoscope
 - Playwright Version: 1.48.1
kj0171 commented 11 hours ago

Sorry for the inconvenience caused. For this particular run, for the 1st try can you please check whether the reporting was configured properly because we at the server end didn't receive any requests. On the retry, we received requests for shards 2,4 and we were able to process them successfully.

[Test being stuck in InProgress] Since, the run was for 5 shards, and we only received shards 2,4. That is why it took some to close the run from our end. It should have been marked completed. Can you please verify if the run is marked as completed now and you are able to see results.

[Can we re-run shards and find the results to be updated] For the service, every run is independent. If you do a re-run from GH Actions, the service will treat it as a new run and will show you the results in the workspace.

For any other queries or issues, you can post it out on GitHub issues. Thanks

angelo-loria commented 10 hours ago

I do see now that they are completing but it takes such a long time that it's not usable. What is an expected timeframe for the report to complete? For example, this one has been processing for over two hours: Image