-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: adds GITHUB_RUN_ATTEMPT counter for tracking retries in the Cypress Cloud #23445
Conversation
Thanks for taking the time to open a PR!
|
55a0843
to
2ec1909
Compare
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
2ec1909
to
47d8655
Compare
@jaimefps Let me check my understanding: the issue here is with the re-used job ID, correct? Because I re-run CircleCI tests all the time. But each job in Circle has a unique job number, so it does not hit this bug. GH Actions re-uses job numbers for retries, causing this issue, correct? If that's the case, then why do we need to fail user tests at all? It sounds like we could concatenate |
Alejandro and I are reviewing if we can avoid throwing errors. |
@flotwig This is the solution we've come up with at this time. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
User facing changelog
Includes
GITHUB_RUN_ATTEMPT
env variable when claiming specs from Cypress Cloud. This allows Cypress Cloud dashboard to distinguish between valid and invalid GH Action requests. This will only fix the problem described above for users of Cypress version 10 and above. Users on Cypress 9 and below will continue to face this issue. We also assume that the customer is generating custom build ids as described here.See GH Actions API docs here
Specifically this portion, contrasting
RUN_ID
withRUN_ATTEMPT
:Additional details
Issue: Customers have reported that retried GH Actions automatically pass when a failed machine is retried. The retried machine is marked as passed without even attempting to rerun Cypress Specs.
Root cause: Cypress Cloud failed to distinguish between a GH Action machine that was "retrying " a task, and a machine that was simply making a request for "unclaimed" Specs in a Run. When the Cypress Run queue for Specs is empty, we would tell the retrying machine that everything is fine and finished, since we didn't know that the request came from a "retry" request.
Temporal solution: We still do not support test retries for partial re-runs of GH Action jobs. But we will correctly exit with an error message in those cases, so that customers don't leave with the impression that the GH Action retry completed successfully.
Steps to test
This requires updates on the Cypress Cloud dashboard. Once those updates are made, the expected behavior is for retries to always throw an error along the lines of "GH Action partial re-runs not supported at this time. Please re-run all jobs". Reach out to Cypress Cloud team to confirm the updates have been included in the Cloud server as well.
How has the user experience changed?
Users will now receive an accurate response from the Cypress Cloud server explaining that we do not support partial retries at this time. For now it is important that customers do not accidentally leave with the impression that failed tests are passing, and that it is safe to merge code after a partial GH Action retry that we incorrectly mark as passed.
This only applies to users of Cypress 10 and above.
PR Tasks
cypress-documentation
?type definitions
?