Skip to content

Commit

Permalink
Try rerunning RuntimeError for example notebooks (#5988)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Nov 17, 2023
1 parent 6d3a282 commit 994b9cd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
25 changes: 0 additions & 25 deletions examples/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,3 @@
"reference/elements/bokeh/VLines.ipynb",
"reference/elements/bokeh/VSpans.ipynb",
]


def pytest_runtest_makereport(item, call):
"""
Skip tests that fail because "the kernel died before replying to kernel_info"
this is a common error when running the example tests in CI.
Inspired from: https://stackoverflow.com/questions/32451811
"""
from _pytest.runner import pytest_runtest_makereport

tr = pytest_runtest_makereport(item, call)

if call.excinfo is not None:
msgs = [
"Kernel died before replying to kernel_info",
"Kernel didn't respond in 60 seconds",
]
for msg in msgs:
if call.excinfo.type == RuntimeError and call.excinfo.value.args[0] in msg:
tr.outcome = "skipped"
tr.wasxfail = f"reason: {msg}"

return tr
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ commands = pytest holoviews --cov=./holoviews --cov-report=xml --ui --browser ch
[_examples]
description = Test that default examples run
deps = .[examples_tests]
commands = pytest -n auto --dist loadscope --nbval-lax examples
commands = pytest -n auto --dist loadscope --nbval-lax examples --reruns 3 --only-rerun RuntimeError

[_all_recommended]
description = Run all recommended tests
Expand Down

0 comments on commit 994b9cd

Please sign in to comment.