Skip to content

QA-PY-103 — wait_for_timeout() as sync ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-PY-103.

FieldValue
Severitywarning
Confidencehigh
Tierextended
Measured FP rate8% (n=25)
Evidence levelE2
QA impactFlaky-test risk (FLAKY-RISK)
False-positive risk (author estimate)low
Autofix availableno
Languagespython
Frameworkspytest-playwright, playwright
Detection strategyLEXICAL
Introduced inv0.3.8

Why this fails in production ​

It is a fixed sleep: it neither guarantees readiness nor fails when the app is broken — it just burns wall-time and flakes under load.

What gets flagged (real detector output) ​

`wait_for_timeout()` used for synchronization.

Example from this rule's own must-fire fixture: tests/fixtures/QA-PY-103/must-fire/test_modal.py

The fix ​

Wait for a condition: expect(locator).to_be_visible(), page.wait_for_url(...), or page.expect_response(...).

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-PY-103/must-not-fire/test_modal.py — a legitimate, similar-looking pattern this rule correctly leaves alone.

Corpus-measured false-positive risk ​

Real occurrence counts from npm run corpus:audit against actively-maintained OSS repos — reproduce yourself, don't just trust this table (see the false-positive audit):

RepoOccurrences
positive-fixtures5
reflex-dev-reflex2
streamlit-streamlit115

Released under the MIT License.