Repository navigation
Labels
area:testingArea: testingArea: testingdjango-migrationPHP to Django migration programPHP to Django migration programkind:ticketImplementable unit of workImplementable unit of workready-for-agentFully specified, with an agent brief; ready for an AFK agentFully specified, with an agent brief; ready for an AFK agent
Description
Goal
Make the browser suite pass when a pytest command names a file outside server/ui/tests/browser/ between two browser files. Today that command fails every later browser test's setup with SynchronousOnlyOperation. The implementer found that pytest 9.1.x binds the browser conftest's fixtures at collection (pytest-dev/pytest#14635, fixed in 9.2.0), so CI's -n auto -m browser ui cannot hit it and the run order does not matter; the PR carries the --collect-only evidence.
Current PHP behavior
- PHP has no counterpart. This is the Django port's browser test harness.
- During kiosk_screens.py reports overlapping elements and text cut short with an ellipsis #256 (master d2355a0), one command run from
server/gave 52SynchronousOnlyOperationerrors at the setup oftest_kiosk_names.py's tests. The command isuv run pytest -m browser -p no:xdist ui/tests/browser/test_shell.py ui/tests/test_kiosk_screens_tool.py ui/tests/browser/test_kiosk_names.py. It was observed once and has not been reproduced since. - The order that failed is a test under
browser/, then a test outside it (ui/tests/test_kiosk_screens_tool.py), thenbrowser/again, all in one worker. - The first suspect, refuted by the implementer, was that
server/ui/tests/browser/conftest.pysetsDJANGO_ALLOW_ASYNC_UNSAFEin its_async_unsafefixture (around line 165), and that the setting is not in force for the later browser tests once a test outside that folder has run.
Scope
- Reproduce the failure with the command above on current master, and record the first error.
- Find the cause, and state the hypothesis that proved true in the PR.
- Fix it, with a regression check that goes red before the fix and green after it.
Out of scope
- Other browser flakes, such as the photo race in
test_photos.pyandtest_kiosk_thumbnails.py.
Acceptance criteria
- The command above passes. Evidence is its output in the PR.
- A regression check fails on master and passes with the fix. Evidence is the check.
- The full browser suite passes on SQLite and on Postgres, since the browser conftest is shared. Evidence is both runs' summaries in the PR.
Risks and notes
- If the command passes on current master, look for an order that does fail, such as another test outside
browser/run between two browser tests, before calling it fixed, or close the ticket with the evidence. - A fix that turns off Django's async safety check for the whole suite would hide real bugs in non-browser tests; scope it to the browser tests.
Dependencies
References
server/ui/tests/browser/conftest.py,server/ui/tests/test_kiosk_screens_tool.py,server/ui/tests/browser/test_kiosk_names.py,server/README.md
Metadata
Metadata
Assignees
Labels
area:testingArea: testingArea: testingdjango-migrationPHP to Django migration programPHP to Django migration programkind:ticketImplementable unit of workImplementable unit of workready-for-agentFully specified, with an agent brief; ready for an AFK agentFully specified, with an agent brief; ready for an AFK agent
Activity
#282: the guard test's docstring states no count it does not assert
#282 review: a test drives the collection hook and the first lost tes…
#282: pytest 9.2, and a browser test that lost the harness fails the …
#282 retro: the pre-push hook also refuses a push after a read of a r…
#282 retro: a push after a pytest run in the same command is refused;…
Lead retro: a Goal states no unverified cause; process PRs get a Stan…
D85: local tests once per hand-off; CI is the full check for diffs th…