Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Cypress Passed on Retry: How to Find the Flaky Test’s Real Cause

A green Cypress status can conceal a failed first attempt. Compare errors, timelines, network activity, and branch history to find what made the test unstable.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Cypress test that passes after a retry is green for that run, but the first failure still matters. Cypress’s documentation puts it plainly: “A test can pass after retries and still be flaky.” Treat the failed attempt as evidence to investigate, not as a problem erased by the later pass.

What a passing retry actually tells you

The test’s assertions passed on a later attempt; they did not pass consistently. Cypress also cautions that a passing test proves only that the assertions you wrote were satisfied. If an important outcome is not asserted—or a test was skipped—the green status does not establish that the behavior is correct. See the Cypress FAQ.

As an Amazon Associate I earn from qualifying purchases.

In Cypress Cloud, a test can show a passed status even though it took multiple attempts. Check the attempt count and each attempt’s error rather than relying on the final status alone. The Cypress Cloud CLI guide explains how to identify passed tests with multiple attempts and inspect their timelines.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Know which kind of retry happened

Query and assertion retry-ability

Within an attempt, Cypress can repeatedly evaluate a query chain and its retryable assertions while waiting for the expected state. This helps with state that takes time to appear, but it does not rerun the entire test. The details depend on the command chain: an assertion chained directly to cy.wait() runs once, whereas a query such as .its() followed by .should() can retry. Cypress documents these distinctions in its cy.wait() API reference.

Configured test retries

A test-level retry reruns the failed test. Cypress’s performance guidance notes that each retry re-executes the test, including its beforeEach and afterEach hooks. With retries: 2, a test can run up to three times total. Cypress illustrates the possible cost: a five-second test with two retries can add up to ten seconds in the worst case; a 15-second test can add up to 30 seconds. Those are examples, not measured averages. See Cypress’s test performance guide.

Compare the failed attempt with the passing one

  1. Open the test’s detail view. In Cypress Cloud, review the attempt errors and stack traces, artifacts, recent pass/fail history, and commits associated with changes. The flaky test management guide describes these diagnostics.
  2. Read the first failure before the retry’s success. Note the command, assertion, and stack location that failed. The first error may identify a specific expectation or operation that the final status obscures.
  3. Compare the attempt timelines. Look at commands, network activity, logs, and timing in both the failed and passing attempts. A slower command, late network response, or changed value may offer a clue; none proves a cause on its own. Cypress’s CLI guidance explains how to inspect attempts.
  4. Check whether the problem is new. Compare the current branch with its base and review relevant commits. Cypress Cloud’s Branch Review can make this comparison when recorded runs exist for both branches. A failure that predates the change suggests existing instability; a new failure associated with a change warrants regression investigation.
  5. Look for uncertainty in setup and state. Ask whether the test depends on a request finishing, data being present, or the DOM reaching a particular state before the next action. Race conditions, timing, and environmental dependencies are possibilities to investigate—not conclusions you can draw from a retry alone.

Make the test wait for evidence, not a guessed duration

When a test depends on a network response, intercept the specific request and wait for it, then assert the relevant response or resulting UI state. Use a retryable query and assertion for UI state that may take time to settle. A fixed sleep does not confirm that the condition you need is true: Cypress warns that arbitrary delays can slow a test and still leave opportunities for flake. Its conditional testing guide also cautions against branching on uncertain DOM state; provide reliable state and facts to the test instead.

Review the assertions themselves as well. Assert the user-visible outcome that matters, and make sure setup leaves the test with known data and state. If the test can pass without checking the behavior that prompted it, a retry cannot make that coverage stronger.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use retries as a safety net, not a repair

Cypress recommends keeping retries deliberate: its guidance suggests a small safety net in CI and no retries in local open mode, while emphasizing that frequently retrying tests are technical debt to fix. Choose a policy that suits your project, but track tests that repeatedly recover and investigate their attempt histories. A retry can reduce the chance that one intermittent failure blocks a run; it cannot establish that the behavior is reliable or remove the cause of the instability.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.