Skip to content

Commit

Permalink
ci: try to fix playwright issue
Browse files Browse the repository at this point in the history
"Navigation to X is interrupted to another navigation to Y"

In the logs we see:
```
FAILED tests/integration/ssg_test.py::test_ssg[starlette-chromium] - playwright._impl._errors.Error: Navigation to "http://localhost:18768/" is interrupted by another navigation to "http://localhost:18768/"
FAILED tests/integration/starlette_test.py::test_starlette_mount[starlette-chromium] - playwright._impl._errors.Error: Navigation to "http://localhost:18770/solara_mount/" is interrupted by another navigation to "http://localhost:18768/"
ERROR tests/integration/widget_test.py::test_widget_button_solara[starlette-chromium] - playwright._impl._errors.Error: Navigation to "http://localhost:18768/?id=4004e29b-a9e6-4b1e-9652-7b1c61ef86cd" is interrupted by another navigation to "http://localhost:18770/solara_mount/"
ERROR tests/integration/widget_test.py::test_solara_button_all[starlette-solara-chromium] - playwright._impl._errors.Error: Navigation to "http://localhost:18768/?id=c8f0b1fb-abdb-4969-b340-1156d2699783" is interrupted by another navigation to "http://localhost:18768/?id=4004e29b-a9e6-4b1e-9652-7b1c61ef86cd"
ERROR tests/integration/widget_test.py::test_slider_all[starlette-solara-chromium] - playwright._impl._errors.Error: Navigation to "http://localhost:18768/?id=680f1fc7-5a19-4e1c-a382-088f2ec96b78" is interrupted by another navigation to "http://localhost:18768/?id=c8f0b1fb-abdb-4969-b340-1156d2699783"
```
  • Loading branch information
maartenbreddels committed Mar 27, 2024
1 parent e77139a commit 5075405
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/solara-enterprise/solara_enterprise/ssg.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def _get_playwright():

pw.browser = pw.sync_playwright.chromium.launch(headless=not settings.ssg.headed)
pw.page = pw.browser.new_page()
playwrights.append(pw)
return pw


Expand Down Expand Up @@ -81,12 +82,13 @@ def wait(async_result):

for result in results:
wait(result)
thread_pool.terminate()
thread_pool.close()
thread_pool.join()
for pw in playwrights:
assert pw.browser is not None
assert pw.context_manager is not None
pw.browser.close()
pw.context_manager.stop()
pw.context_manager.__exit__(None, None, None)

rprint("Done building SSG")

Expand Down

0 comments on commit 5075405

Please sign in to comment.