Browser tests: wait for the page's state, not for a fixed time #723

Closed
opened 2026-10-04 20:43:14 +00:00 by tiagoagueda · 0 comments
Owner

Measured from Forgejo's task API and job logs, runs 561–710 (24 Sep – 4 Oct 2026): wall time per push about 52–55 min, up from about 15; the browser suite grew from 149 to 645 tests in five days and runs serially (29 min); the runner takes two jobs at a time, in the order the workflow file lists them, so the browser job starts 19–22 min after the push; and Forgejo cancels the older push run when a newer push lands, which stopped 18 of 56 browser jobs before they gave a verdict.

There are 54 wait_for_timeout calls in 14 browser test files (test_board_fold.py 16, test_help.py 13, test_navigation_bar.py 6), about 17 seconds of literal waiting before parametrisation multiplies it. A fixed wait is too long on a quiet machine and too short on a loaded one.

Proposal

  • A wait that stands in for "until the page has done X" becomes a retrying expect on X.
  • A wait that is the subject of the test, such as the key-repeat, stillness and scroll-speed checks in test_board_fold.py (:376, :1128, :1217), moves to Playwright's page.clock where the page's timers allow it, or stays with a comment saying why.

Done when

  • Every remaining wait_for_timeout carries a comment saying what time it measures.
Measured from Forgejo's task API and job logs, runs 561–710 (24 Sep – 4 Oct 2026): wall time per push about 52–55 min, up from about 15; the browser suite grew from 149 to 645 tests in five days and runs serially (29 min); the runner takes **two jobs at a time, in the order the workflow file lists them**, so the browser job starts 19–22 min after the push; and Forgejo cancels the older push run when a newer push lands, which stopped 18 of 56 browser jobs before they gave a verdict. There are 54 `wait_for_timeout` calls in 14 browser test files (`test_board_fold.py` 16, `test_help.py` 13, `test_navigation_bar.py` 6), about 17 seconds of literal waiting before parametrisation multiplies it. A fixed wait is too long on a quiet machine and too short on a loaded one. ## Proposal - A wait that stands in for "until the page has done X" becomes a retrying `expect` on X. - A wait that is the subject of the test, such as the key-repeat, stillness and scroll-speed checks in `test_board_fold.py` (`:376`, `:1128`, `:1217`), moves to Playwright's `page.clock` where the page's timers allow it, or stays with a comment saying why. ## Done when - Every remaining `wait_for_timeout` carries a comment saying what time it measures.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#723
No description provided.