Skip to content

Re-run only failed tests (jobs) for Cloud parallel recording #1290

Description

@MikeMcC399

What would you like?

Scenario

A GitHub Actions workflow contains a job using the parallel option of cypress-io/github-action recording to Cypress Cloud which runs Cypress tests in multiple containers.

One or more Cypress tests fail.

GitHub Actions offers the option Re-run failed jobs

image

Enhancement

GitHub Actions and Cypress Cloud should work together so that selecting Re-run failed jobs only re-runs failed jobs using a frozen set of load-balanced Cypress test specs, so that each failed job runs with the same test specs it used in its previous run. The Cypress tests which were distributed to other jobs, and which were previously successful, should not be re-run.

Why is this needed?

Reduce the overhead of re-running flaky tests without also running tests which were previously successful.

Other

The README > parallel documentation section currently states:

If you use the GitHub Actions facility for Re-running workflows and jobs, note that Re-running failed jobs in a workflow is not suited for use with parallel recording into Cypress Cloud. Re-running failed jobs in this situation does not simply re-run failed Cypress tests. Instead it re-runs all Cypress tests, load-balanced over the containers with failed jobs.

To optimize runs when there are failing tests present, refer to optional Cypress Cloud Smart Orchestration Premium features:

Activity

  1. theomelo commented on Oct 31, 2024

    @theomelo

    @MikeMcC399 I would like to investigate this issue. Can you confirm if a deep knowledge of Cypress Cloud's "inner workings" (how the parallelization works, etc.) is required?

  2. MikeMcC399 commented on Nov 1, 2024

    @MikeMcC399
    CollaboratorAuthor

    @theomelo

    Can you confirm if a deep knowledge of Cypress Cloud's "inner workings" (how the parallelization works, etc.) is required?

    I can't help you with your question. https://docs.cypress.io/cloud/features/smart-orchestration/parallelization describes the parallel load-sharing process. Although the Cypress code on https://github.com/cypress-io/cypress is open source and online viewable, the Cypress Cloud code, which implements load-sharing, is proprietary to Cypress.io and not shared online. I don't have access to the Cypress Cloud code myself and so I can't say how much you would need to know about it.

  3. changed the title [-]Re-run only failed tests for Cloud parallel recording[/-] [+]Re-run only failed tests (jobs) for Cloud parallel recording[/+] on Nov 5, 2024
  4. brunokrebs commented on Jun 11, 2025

    @brunokrebs

    More than 3 years knowing about this, dozens of messages on the original issue, and no support from Cypress Cloud? That alone, to me, is making me look for e2e browser-based test support elsewhere. That even affects CCTs if you want to run them in parallel... that is, if any flaky test fails either on CCTs or e2e, you literally have to run your entire GHA test suite (all the checks) again.

    Anyway, all good, the company probably has a good-ish (in their opinion) reason not address this issue for GHA and Cypress Cloud customers.

  5. MikeMcC399 commented on Jun 13, 2025

    @MikeMcC399
    CollaboratorAuthor

    This issue is not resolvable by changing anything in this repo. It was opened and is left open for the possibility that the Cypress Cloud team might want to respond to it here, although the official route for Cypress Cloud support according to information on the Cypress Help Center page is through Cypress Cloud tickets for customers on a paid plan (Team, Business or Enterprise), and through Discord commmunity support for those using the free tier "Starter" plan.

    If parallel recording steps using cypress-io/github-action in a GitHub Actions workflow are replaced with steps that use the Cypress CLI cypress run command instead, then the same issue remains, that the Re-run failed jobs button re-runs all Cypress test specs.

    For example, if the steps section in the following snippet using cypress-io/github-action, is replaced:

    env:
      CYPRESS_PROJECT_ID: ${{ secrets.EXAMPLE_PROJECT_ID }}
      CYPRESS_RECORD_KEY: ${{ secrets.EXAMPLE_RECORDING_KEY }}
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    # Using cypress-io/github-action
    parallel:
        runs-on: ubuntu-24.04
        strategy:
          fail-fast: false
          matrix:
            containers: [1, 2, 3]
        steps:
          - uses: actions/checkout@v4
          - uses: cypress-io/github-action@v6
            with:
              record: true
              parallel: true

    using instead the Cypress CLI:

        steps:
          - uses: actions/checkout@v4
          - run: npm ci
          - run: npx cypress run --record --parallel

    then the same problem occurs if Cypress test failures occur, but not in all the containers. The GitHub Actions button Re-run failed jobs re-runs only the failing containers, and Cypress Cloud load-balances all Cypress test-specs across the container sub-set. This indicates that the issue is not coming from cypress-io/github-action.

    Even though this isn't the right place for the issue, because it concerns Cypress Cloud software which is not part of this repo, I'm not aware of any alternate place to view open issues that are specific to Cypress Cloud, so at this time I intend to leave it open here.

  6. jennifer-shehane commented on May 4, 2026

    @jennifer-shehane
    Member

    We are currently working on some solutions for having a way to re-run only failed specs within Cypress.

  7. mellis481 commented on Jun 8, 2026

    @mellis481

    @jennifer-shehane Is there a ticket I can follow in place of this Github issue?

  8. MikeMcC399 commented on Jun 9, 2026

    @MikeMcC399
    CollaboratorAuthor

    @mellis481

    Is there a ticket I can follow in place of this Github issue?

    If there were an alternate location to follow the progress of Cypress Cloud work, I would close this issue and defer to the alternate location. Cypress Cloud is however closed source, so unless Cypress.io started publishing a roadmap for Cypress Cloud, I don't know how this would work.

  9. MikeMcC399 commented on Sep 2, 2026

    @MikeMcC399
    CollaboratorAuthor

    @jennifer-shehane

    I notice the documentation page Cypress Cloud > Re-run optimization talks about an experimental option as part of a Cloud Business Plan to run only failed tests or run only failed specs.

    It mentions GitHub Actions, however I couldn't find any specific reference to to Cypress Cloud recording from parallel GitHub Actions jobs.

    Would you recommend it at this time as a full or partial solution to the issue described here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions