CS FundamentalsHardProduct-company placement

A test in the CI suite passes and fails randomly on the same commit because it depends on timing. Developers have started re-running pipelines until they go green. What is the best practice?

  1. A. Delete the test permanently
  2. B. Increase all timeouts in the suite tenfold
  3. C. Quarantine the flaky test from the merge gate, track it as a defect and fix its root cause (e.g. replace sleeps with explicit waits or fake clocks)
  4. D. Ignore it, since most runs pass

Correct answer: C. Quarantine the flaky test from the merge gate, track it as a defect and fix its root cause (e.g. replace sleeps with explicit waits or fake clocks)

Flaky tests teach people to ignore red builds, which defeats CI. Isolating them keeps the gate trustworthy while the cause (timing, shared state, order dependence) is fixed.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic