Canceling Runs
Cancelling Cypress and Playwright CI tests runs
Last updated
Cancelling Cypress and Playwright CI tests runs
Last updated
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
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.
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
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 Fail Fast Strategy)
If you have Fail Fast Strategy activated for a project, runs cancelled because of fail-fast strategy will be marked with a special badge:
You can automatically cancel Currents runs (cypress and playwright) when cancelling GitHub Actions workflow using cancel-run-gh-action.
Check out the example workflow configuration:
The example above uses a GitHub Actions repository secret named CURRENTS_API_KEY.
For creating a new API secret please refer to API Keys.
After the step is enabled, cancelling a GitHub Actions workflow will trigger cancellation:
The associated Currents run will be cancelled with the corresponding notes:
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
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
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)
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
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
Currents will post a cancellation notification with the last known run results
A new HTTP POST request will be emitted with the last known run results. and event type RUN_CANCELED
See HTTP Webhooks for details.