Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - TimeoutError in Playwright Notebook tests #2642

Closed
viniciusdc opened this issue Aug 27, 2024 · 0 comments · Fixed by #2644
Closed

[BUG] - TimeoutError in Playwright Notebook tests #2642

viniciusdc opened this issue Aug 27, 2024 · 0 comments · Fixed by #2644
Assignees
Labels
area: testing ✅ Testing type: bug 🐛 Something isn't working

Comments

@viniciusdc
Copy link
Contributor

Describe the bug

We are encountering a TimeoutError when running the test_notebook test within our CI pipeline in mostly of our current PRs. The error occurs during the reset_workspace method in the navigator.py file, specifically when waiting for the page load state to reach "networkidle." The test fails with the following traceback:

  File "/home/runnerx/actions-runner/_work/nebari/nebari/tests/common/navigator.py", line 252, in reset_workspace
    popup = self._check_for_kernel_popup()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runnerx/actions-runner/_work/nebari/nebari/tests/common/navigator.py", line 236, in _check_for_kernel_popup
    self.page.wait_for_load_state("networkidle")
  File "/home/runnerx/miniconda3/envs/test/lib/python3.11/site-packages/playwright/sync_api/_generated.py", line 8949, in wait_for_load_state
    self._sync(self._impl_obj.wait_for_load_state(state=state, timeout=timeout))
  File "/home/runnerx/miniconda3/envs/test/lib/python3.11/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
    return task.result()
           ^^^^^^^^^^^^^
  File "/home/runnerx/miniconda3/envs/test/lib/python3.11/site-packages/playwright/_impl/_page.py", line 540, in wait_for_load_state
    return await self._main_frame.wait_for_load_state(**locals_to_params(locals()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runnerx/miniconda3/envs/test/lib/python3.11/site-packages/playwright/_impl/_frame.py", line 243, in wait_for_load_state
    return await self._wait_for_load_state_impl(state, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runnerx/miniconda3/envs/test/lib/python3.11/site-packages/playwright/_impl/_frame.py", line 271, in _wait_for_load_state_impl
    await waiter.result()
playwright._impl._errors.TimeoutError: Timeout 30000ms exceeded.

During an initial debug of this issue, it was observed that waiting for the "networkidle" state was not required. A simple wait_for_load_state call without specifying the state resolved the timeout issue. However, additional issues were encountered related to environment selection within the kernel selector popups in the tests themselves, which might require further investigation and refactoring.

Expected behavior

  • Playwright tests succeeding

OS and architecture in which you are running Nebari

Linux

How to Reproduce the problem?

The test that triggers this error is located in the test_playwright.py file under the test_notebook function, which relies on the following setup:

from tests.common.playwright_fixtures import navigator_parameterized
from tests.common.run_notebook import Notebook

@navigator_parameterized(instance_name="small-instance")
def test_notebook(navigator, test_data_root):
    test_app = Notebook(navigator=navigator)
    notebook_name = "test_notebook_output.ipynb"
    notebook_path = test_data_root / notebook_name
    assert notebook_path.exists()
    with open(notebook_path, "r") as notebook:
        test_app.nav.write_file(filepath=notebook_name, content=notebook.read())
    test_app.run(
        path=notebook_name,
        expected_outputs=["success: 6"],
        conda_env="default *",
        timeout=500,
    )

You can follow the readme instructions on how to run the e2e tests locally.

Command output

No response

Versions and dependencies used.

No response

Compute environment

None

Integrations

No response

Anything else?

This issue must be resolved as it is a significant obstacle in our testing workflows, causing disruptions and preventing other tests from running successfully in most of our recent PRs.

@viniciusdc viniciusdc added type: bug 🐛 Something isn't working area: testing ✅ Testing needs: triage 🚦 Someone needs to have a look at this issue and triage labels Aug 27, 2024
@viniciusdc viniciusdc self-assigned this Aug 29, 2024
@github-project-automation github-project-automation bot moved this from In progress 🏗 to Done 💪🏾 in 🪴 Nebari Project Management Aug 30, 2024
@Adam-D-Lewis Adam-D-Lewis removed the needs: triage 🚦 Someone needs to have a look at this issue and triage label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: testing ✅ Testing type: bug 🐛 Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants