fix: run Shiny E2E apps as subprocesses (demonstrate shinychat main issue) - #279
Conversation
Demonstrates that shinychat main alone breaks the Shiny sidebar E2E tests (test_03_sidebar_apps.py title tests) due to a timing regression introduced in posit-dev/shinychat#280 interacting with the in-process app servers used by the Playwright fixtures.
…_fixture The threaded in-process uvicorn fixtures shared Shiny's process-global, loop-bound reactive lock across apps. When two apps on different event loops contended for the lock, the session's message handler crashed with 'bound to a different event loop' and the chat message was dropped, hanging the sidebar title tests. shinychat main (posit-dev/shinychat#280) widened that race window enough to fail CI reliably. create_app_fixture runs each app in its own subprocess (as Shiny's own test suite does), giving each app its own loop and lock. This matches how the Streamlit fixtures already work.
|
Update: the pin-only commit (bf87e71) hit the 30-minute E2E timeout as expected — failed tests included both sidebar title tests (the reactive-lock race) and the test_10 viz inline tests (main's viz tests expect shinychat 0.6.x tool-result DOM; those test updates live in #274). The fixture-rewrite commit (89caac3) should fix the sidebar title failures. The viz inline failures are expected to remain here since this PR doesn't include #274's test updates. |
shinychat main (176a8fc) replaced the conditional send/cancel/spinner button classes with a single button using data-state. The .shiny-chat-btn-cancel class no longer exists.
|
Follow-up: the cancel-test failures in the post-fix runs were not caused by the fixture change. The |
app_01_hello is now a create_app_fixture (ShinyAppProc), so page.goto needs .url. Missed in 89caac3.
The first commit pins shinychat to git main to demonstrate that shinychat main alone (specifically posit-dev/shinychat#280) breaks the Shiny sidebar E2E tests: the in-process threaded uvicorn fixtures share Shiny's process-global, loop-bound reactive lock across apps, and the second app's session dies on lock contention.
The second commit rewrites the Shiny Playwright fixtures to use shiny.pytest.create_app_fixture, which runs each app as a subprocess (matching Shiny's own test suite and our Streamlit fixtures), eliminating the shared-lock hazard.
Expected: E2E fails on the first commit (sidebar title tests), passes after the second.
Later commits adapt the viz Playwright suites (test_10–12) to shinychat main's tool-result DOM (routed results render as
.shiny-tool-cardinside.shiny-chat-tool-group; the.shiny-tool-resultwrapper is now fallback-only) — moved here from #274 — and fix test_13 to useShinyAppProc.url.