Currents Documentation
Currents.devGitHubChangelog
  • Getting Started
    • What is Currents?
    • Playwright
      • Playwright: Quick Start
      • Troubleshooting Playwright
    • Cypress
      • Your First Cypress Run
      • Integrating with Cypress
        • Compatibility
        • Alternative Cypress Binaries
      • Troubleshooting Cypress
    • Jest
      • Your First Jest Run
      • Detox + Jest
      • Troubleshooting Jest
    • Others
    • CI Setup
      • GitHub Actions
        • Cypress - GitHub Actions
        • Playwright - GitHub Actions
        • Jest - GitHub Actions
        • Node.js - GitHub Actions
        • Commit data for GitHub Actions
        • Custom Docker runners
        • Named Runners
      • GitLab
        • Cypress - GitLab CI/CD
        • Playwright - GitLab CI/CD
        • Custom Docker runners
      • Jenkins
        • Cypress - Jenkins
        • Playwright - Jenkins
      • CircleCI
        • Cypress - CircleCI
        • Playwright - CircleCI
      • Bitbucket
        • Cypress - Bitbucket Pipelines
      • Azure DevOps
        • Cypress - Azure DevOps
        • Playwright - Azure DevOps
      • AWS Code Build
        • Cypress - AWS Code Build
        • Playwright - AWS Code Build
      • NX
        • Playwright - NX
        • Cypress - NX
  • Guides
    • Record Key
    • CI Build ID
    • Reporting
      • Reporting Strategy
      • Reporting in CI
      • Step-Level Reporting
    • CI Optimization
      • Playwright Parallelization
      • Orchestration Setup
      • Fully Parallel Mode
      • Re-run Only Failed Tests
      • Cloud Spot Instances
      • Failing Fast
      • Load Balancing
    • Code Coverage
      • Code Coverage for Playwright
      • Code Coverage for Cypress
    • Currents Actions
      • Setup Currents Actions
      • Using Currents Actions
      • Reference
        • Conditions
        • Actions
    • Playwright Component Testing
    • Playwright Visual Testing
    • Playwright Annotations
    • Playwright Tags
    • MCP Server
  • Dashboard
    • Projects
      • Projects Summary view
      • Project Settings
      • Archive and Unarchive Projects
    • Runs
      • Run Status
      • Run Details
      • Commit Information
      • Tags
      • Run Timeouts
      • Cancelling Runs
      • Deleting Runs
      • Run Progress
    • Tests
      • Spec File Status
      • Test Status
      • Flaky Tests
      • Test History
    • Test Suite Explorer
      • Test Explorer
      • Spec Files Explorer
      • Error Explorer
      • Reference
  • Automated Reports
  • Insights and Analytics
  • Administration
    • Email Domain Based Access
    • SSO SAML2.0
      • SAML2.0 Configuration
      • SCIM User Provisioning
      • IdP-initiated Sessions
      • JumpCloud
        • JumpCloud User provisioning
      • Okta
        • Okta User provisioning
      • Troubleshooting SSO
    • Billing & Usage
  • Billing and Pricing
  • Resources
    • Reporters
      • cypress-cloud
        • Batched Orchestration
        • Migration to Cypress@13
      • @currents/cli
      • @currents/playwright
        • Configuration
        • pwc
        • pwc-p (orchestration)
        • Playwright Fixtures
      • @currents/jest
      • @currents/node-test-reporter
      • @currents/cmd
        • currents api
        • currents upload
        • currents cache
        • currents convert
      • Data Format Reference
    • Integrations
      • GitHub
        • GitHub App
        • GitHub OAuth
      • GitLab
      • Slack
      • Microsoft Teams
      • HTTP Webhooks
      • Bitbucket
    • API
      • Introduction
      • Authentication
      • API Keys
      • Errors
      • Pagination
      • API Resources
        • Instances
        • Runs
        • Projects
        • Spec Files
        • Test Signature
        • Test Results
    • Data Privacy
      • Access to Customer Data
      • Data Retention
      • Cloud Endpoints
    • Support
Powered by GitBook
On this page
  • Cancelling Runs via Dashboard
  • Cancelling Runs via API
  • Cancellation by Fail-Fast
  • GitHub Actions Workflow Cancellation
  • FAQ
  • What happens when a run is cancelled?
  • Cancelling runs and analytics
  • How does cancelling a run affect test records plan usage?
  • How does cancelling a run affect integrations (GitHub, Slack, etc.)?

Was this helpful?

  1. Dashboard
  2. Runs

Cancelling Runs

Cancelling Cypress and Playwright CI tests runs

PreviousRun TimeoutsNextDeleting Runs

Last updated 21 days ago

Was this helpful?

Runs that are currently in progress can be cancelled using the dashboard controls or via an API call.

Cancelling a run can be useful for:

  • preventing a run from timing out

  • optimizing usage of your CI provider resources

  • reducing the number of recorded tests

Please note: Cancelling a run cannot be undone

Cancelling Runs via Dashboard

In-progress runs can be cancelled by clicking the "Cancel Run" button in the Runs Feed view.

You can also cancel a run when from the Run Details view.

Cancelling Runs via API

You can programmatically cancel a run via the PUT runs/:runId/cancel HTTP API call. For example, here is an example of curl command that cancels a particular run

curl --location --request PUT 'https://api.currents.dev/v1/runs/:runId/cancel' \
--header 'Authorization: Bearer <currents API token>'

By using the API call you can extend the - for example:

  • cancel a run after CI pipeline is stopped/cancelled

  • cancel a run when a particular condition is met, e.g.:

    • activate HTTP Webhooks and parse the results

    • based on the results (e.g. encountering a particular error message), send the cancellation request

  • cancel a run when a certain number of failed tests are detected (it is natively supported via Failing Fast)

Cancellation by Fail-Fast

If you have Failing Fast activated for a project, runs cancelled because of fail-fast strategy will be marked with a special badge:

GitHub Actions Workflow Cancellation

      # Run all Currents tests
      - name: Run Cypress on Currents.dev
        uses: cypress-io/github-action@v4
        with:
          command: npx cypress-cloud run --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}

      - name: Cancel the run if the workflow is cancelled
        if: ${{ cancelled() }}
        uses: currents-dev/cancel-run-gh-action@v1
        with:
          api-token: ${{ secrets.CURRENTS_API_KEY }}
          github-run-id: ${{ github.run_id }}
          github-run-attempt: ${{ github.run_attempt }}

After the step is enabled, cancelling a GitHub Actions workflow will trigger cancellation:

The associated Currents run will be cancelled with the corresponding notes:

FAQ

What happens when a run is cancelled?

Cancelling a run affects in-progress and pending tests, as well as integrations and run analytics.

  • the run will be marked as "Cancelled", depending on the test's status, it can also become "Failed" or "Passed". See Run Status.

  • in-progress tests will run to completion, the dashboard will accept their result

  • attempts to start a new test for a cancelled run would fail with the error message Run is cancelled

Cancelling runs and analytics

  • Cancelled runs are excluded from Runs Duration Insights

  • Cancelled runs are excluded from Test / Spec Size Insights

  • Tests recorded as part of a cancelled run are still included in Tests Insights charts

How does cancelling a run affect test records plan usage?

  • Only fully recorded tests consume your organization's test records limit.

  • Cancelled runs do consume your organization's runs limit (for organizations on deprecated runs-based plans)

How does cancelling a run affect integrations (GitHub, Slack, etc.)?

GitHub / BitBucket Commit Status Check

  • Commit status checks will display Cancelled by <username> message

  • Commit status check outcome will be set according to the last known run status, for example

    • if no failed tests were recorded before the cancellation, the status check outcome will be a success

    • otherwise, the status check outcome will be a failure

GitHub PR Comment

  • Currents will post a new PR comment with Cancelled by <username> message

  • PR comment details will be set according to the last known run status

Slack / MS Teams

  • Currents will post a cancellation notification with the last known run results

HTTP Webhooks

A new HTTP POST request will be emitted with the last known run results and event type RUN_CANCELED See HTTP Webhooks for details.

You can automatically cancel Currents runs (cypress and playwright) when cancelling GitHub Actions workflow using .

Check out the :

The example above uses a named CURRENTS_API_KEY. For creating a new API secret please refer to API Keys.

cancel-run-gh-action
example workflow configuration
GitHub Actions repository secret
Cancelling from Runs Feed view
Cancelling Run Details view
Example of a run cancelled by a dashboard user
Example of a run cancelled by fail-fast strategy
Example of a cancellation step
Cancelling cypress tests run - GitHub commit status message
Cancelling cypress tests run - GitHub PR comment
Cancelling cypress tests run - Slack message example
Cancelling cypress tests run - MS Teams example