Skip to content
SDETRole
SDETRole

Detect flaky tests from rerun history

intermediate Flaky tests Challenge 8 of 13

Your CI retries failed tests once. Use the run history to find flaky tests: tests that both failed and passed on the same build.

Requirements

  • Return each flaky test’s title and flaky_builds: the number of builds on which it both failed and passed.
  • A test that failed on a build without passing on that build is not flaky on that build.
  • Only include tests that were flaky on at least one build.

Expected output

title | flaky_builds Apply SAVE10 coupon | 2 Search by product name | 1

Checks (3)

  • ○Sample data
  • ○The broken checkout test passes on rerun
  • ○The coupon rerun on build 105 also fails

Each check builds a fresh database and compares your result with the reference solution's: same number of columns in the same order (names are not checked), and the same rows in any order.

query.sqlExecutes on SQLite in your browser

Ctrl/⌘ + Enter to check query · your code is saved in this browser

Results

Use Run query to see your rows, then Check query to grade it.

Schema · QA Tracker

SQLite

Loading the database…

“null” marks columns that allow NULL. Foreign keys are not enforced, as in many real test databases.

Type to search across SDETRole.

Full-text search by Pagefind · runs in your browser Open search page →