diff --git a/.woodpecker/main.yaml b/.woodpecker/main.yaml index 780f59a..f66bab3 100644 --- a/.woodpecker/main.yaml +++ b/.woodpecker/main.yaml @@ -64,31 +64,29 @@ steps: - "requirements.txt" - ".woodpecker/main.yaml" - # ── FT split (sequential for now) ───────────────────────────────────── + # ── FT split (stage-parallel, intra-stage sequential) ───────────────── # # test_game_room_* is the heaviest cluster — 9 Selenium-driven room-flow # FTs that historically dominate the FT step wall-clock (~70% of the # ~40-min single-step runs). Split off into its own step (`test-FTs-room`) # so the partition is visible in the pipeline view; the non-room bucket - # runs first as `test-FTs-non-room`. test-FTs-non-room depends on - # test-two-browser-FTs (collectstatic'd assets in shared workspace); - # test-FTs-room depends on test-FTs-non-room. + # is `test-FTs-non-room`. Both depend on test-two-browser-FTs only, so + # they fan out + run concurrently. # - # NOTE — currently sequential, not parallel. Both FT steps share the - # workspace AND fall back to SQLite (only test-UTs-n-ITs has - # `DATABASE_URL` pointing at the postgres service). When they ran - # concurrently (both depending on test-two-browser-FTs), the second - # step to start hit a half-created `src/test_db.sqlite3` and prompted - # "Type 'yes' to delete the existing test database" → EOFError under - # non-interactive CI stdin. See pipeline run #296. + # The previous SQLite-collision blocker (pipeline #296: second step + # started against the first step's half-created `src/test_db.sqlite3` + # → Django interactive prompt → EOFError under non-interactive CI + # stdin) is resolved by giving each step a distinct `DATABASE_URL` + # pointing at its own sqlite file under /tmp — outside the shared + # workspace mount so the two stages can't see each other's DB. # - # To re-parallelise later, give each step its own DB: - # - point `DATABASE_URL` at distinct sqlite paths per step - # (e.g. `sqlite:////tmp/test_db_room.sqlite3` vs `_non_room`), or - # - have each step point at its own postgres DB (the existing - # `postgres` service already exposes one; spin up a second or - # `CREATE DATABASE` per step). - # Until then, test-FTs-room runs after test-FTs-non-room. + # `--parallel` is dropped from both steps. Empirically (pipelines + # #302-304) it was giving ~1-1.5x speedup at most on these Selenium + # FTs — Firefox spawn cost + RAM pressure + SQLite file-lock contention + # eat most of the gain — while amplifying every transient-DOM flake + # (login-race, gecko-perms, ElementNotInteractable, Jasmine-timeout). + # Stage-level parallelism gives the same wall-clock reduction without + # contention amplification. - name: test-FTs-non-room image: gitea.earthmanrpg.me/discoman/python-tdd-ci:latest @@ -96,6 +94,9 @@ steps: - test-two-browser-FTs environment: HEADLESS: 1 + # /tmp path (not workspace-relative) so the parallel test-FTs-room + # step can't see this DB + vice versa. See split-rationale above. + DATABASE_URL: sqlite:////tmp/test_db_non_room.sqlite3 CELERY_BROKER_URL: redis://redis:6379/0 REDIS_URL: redis://redis:6379/1 STRIPE_SECRET_KEY: @@ -109,7 +110,7 @@ steps: # Every FT file EXCEPT test_game_room_* — that cluster runs in # test-FTs-room. Channels + two-browser tags already covered upstream. # `ls | grep -v | sed` enumerates module dotted-paths from filenames. - - python manage.py test --parallel --exclude-tag=channels --exclude-tag=two-browser $(ls functional_tests/test_*.py | grep -v 'test_game_room_' | sed 's|/|.|g;s|\.py||') + - python manage.py test --exclude-tag=channels --exclude-tag=two-browser $(ls functional_tests/test_*.py | grep -v 'test_game_room_' | sed 's|/|.|g;s|\.py||') when: - event: push path: @@ -120,9 +121,12 @@ steps: - name: test-FTs-room image: gitea.earthmanrpg.me/discoman/python-tdd-ci:latest depends_on: - - test-FTs-non-room + - test-two-browser-FTs environment: HEADLESS: 1 + # /tmp path (not workspace-relative) so test-FTs-non-room can't see + # this DB + vice versa. See split-rationale above. + DATABASE_URL: sqlite:////tmp/test_db_room.sqlite3 CELERY_BROKER_URL: redis://redis:6379/0 REDIS_URL: redis://redis:6379/1 STRIPE_SECRET_KEY: @@ -135,9 +139,9 @@ steps: - cd ./src # Heavy Selenium room flows — 9 files (deck_contrib, gatekeeper, # invite, select_role/sea/sig/sky, tray, tray_tooltip) isolated - # into their own sub-step. Runs after test-FTs-non-room (shared - # SQLite test DB; see split-rationale comment above). - - python manage.py test --parallel --exclude-tag=channels --exclude-tag=two-browser $(ls functional_tests/test_game_room_*.py | sed 's|/|.|g;s|\.py||') + # into their own sub-step. Runs in parallel w. test-FTs-non-room + # (distinct DATABASE_URL paths under /tmp; see split-rationale). + - python manage.py test --exclude-tag=channels --exclude-tag=two-browser $(ls functional_tests/test_game_room_*.py | sed 's|/|.|g;s|\.py||') when: - event: push path: diff --git a/src/functional_tests/test_core_bud_btn.py b/src/functional_tests/test_core_bud_btn.py index b673dbe..e0b66ec 100644 --- a/src/functional_tests/test_core_bud_btn.py +++ b/src/functional_tests/test_core_bud_btn.py @@ -427,9 +427,12 @@ class BudBtnDuplicateShareErrorTest(FunctionalTest): self.assertNotIn("bud-duplicate-flash", chip.get_attribute("class") or "") # FYI dismisses + applies flash class - self.browser.find_element( - By.CSS_SELECTOR, ".note-banner--duplicate .note-banner__fyi" - ).click() + self.wait_for(lambda: self.browser.execute_script( + "arguments[0].click()", + self.browser.find_element( + By.CSS_SELECTOR, ".note-banner--duplicate .note-banner__fyi" + ), + )) self.wait_for(lambda: self.assertEqual( self.browser.find_elements(By.CSS_SELECTOR, ".note-banner--duplicate"), [], @@ -503,9 +506,17 @@ class GatekeeperBudBtnAsyncInviteTest(FunctionalTest): lambda: self.browser.find_element(By.ID, "id_recipient") ) recipient_input.send_keys(recipient) - self.browser.find_element( - By.CSS_SELECTOR, "#id_bud_panel .btn.btn-confirm" - ).click() + # wait_for + execute_script bypasses Selenium's scroll-into-view + # gate — under CI contention the post-send_keys autocomplete dropdown + # can briefly overlap the OK button + Firefox refuses the click w. + # ElementNotInteractableException (pipeline #304). Same shape as + # confirm_guard in base.py. + self.wait_for(lambda: self.browser.execute_script( + "arguments[0].click()", + self.browser.find_element( + By.CSS_SELECTOR, "#id_bud_panel .btn.btn-confirm" + ), + )) return bud_btn def test_invite_creates_room_invite(self): @@ -579,7 +590,13 @@ class GatekeeperBudBtnDuplicateInviteErrorTest(FunctionalTest): btn.click() recipient = self.wait_for(lambda: self.browser.find_element(By.ID, "id_recipient")) recipient.send_keys("alice@test.io") - self.browser.find_element(By.CSS_SELECTOR, "#id_bud_panel .btn.btn-confirm").click() + # See _open_panel_and_invite (above) for the bypass rationale. + self.wait_for(lambda: self.browser.execute_script( + "arguments[0].click()", + self.browser.find_element( + By.CSS_SELECTOR, "#id_bud_panel .btn.btn-confirm" + ), + )) title = self.wait_for(lambda: self.browser.find_element( By.CSS_SELECTOR, ".note-banner--duplicate .note-banner__title" @@ -600,9 +617,12 @@ class GatekeeperBudBtnDuplicateInviteErrorTest(FunctionalTest): ) self.assertNotIn("bud-duplicate-flash", slot.get_attribute("class") or "") - self.browser.find_element( - By.CSS_SELECTOR, ".note-banner--duplicate .note-banner__fyi" - ).click() + self.wait_for(lambda: self.browser.execute_script( + "arguments[0].click()", + self.browser.find_element( + By.CSS_SELECTOR, ".note-banner--duplicate .note-banner__fyi" + ), + )) self.wait_for(lambda: self.assertEqual( self.browser.find_elements(By.CSS_SELECTOR, ".note-banner--duplicate"), [],