BDD & TDD / Scenario
The Suite That Cried Wolf
A test file with sleeps, shared state, a conditional assertion, and order-dependent tests. Rank the rot and prescribe the fixes.
- Difficulty
- Hard
- Format
- Scenario
- Points
- 200
- Estimate
- 14 min
// MISSION BRIEF
Your Mission
This suite is green most days, red some days, and nobody trusts it either way. Read the file and the CI history, identify each defect pattern, and choose fixes that restore signal.
Scoring: weighted decisions; the core reliability call counts double.
// FIRST CONTACT
Battle teaser
First artifact
orders.spec.ts
"places an order" fails intermittently with PROCESSING. The defect and the durable fix:
- AThe sleep is too short; raise it to 15 seconds
- BAssert PROCESSING instead, it is more common
- CAdd a retry so the second attempt usually passes
- DA fixed sleep races async processing; poll/await the CONFIRMED condition with a timeout instead of sleeping a guessed duration
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
test-qualityflakinesstest-designcode-review