Skip to content

Commit f90ba1b

Browse files
authored
Merge pull request FRRouting#19534 from donaldsharp/ignore_backtraces
doc, tests: Add `--ignore-backtraces` command to pytest
2 parents 6d13e5d + 9976ba9 commit f90ba1b

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

doc/developer/topotests.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,25 @@ Here's an example of launching ``vtysh`` on routers ``rt1`` and ``rt2``.
593593
594594
sudo -E pytest --vtysh=rt1,rt2 all-protocol-startup
595595
596+
Ignoring Backtrace Detection
597+
""""""""""""""""""""""""""""
598+
599+
By default, topotests automatically check for backtraces in daemon log files after
600+
each test execution. If backtraces are detected, the test will fail. However, in
601+
some scenarios you may want to disable this automatic backtrace detection.
602+
603+
To disable backtrace detection during test execution, use the ``--ignore-backtraces``
604+
CLI option:
605+
606+
.. code:: shell
607+
608+
sudo -E pytest --ignore-backtraces all-protocol-startup
609+
610+
This option is useful when:
611+
- Running tests in environments where backtraces are expected or acceptable
612+
- Debugging specific issues where backtrace detection interferes with test execution
613+
- Running tests with known issues that produce backtraces but are not critical
614+
596615
.. _debug_with_gdb:
597616

598617
Debugging with GDB

tests/topotests/conftest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ def pytest_addoption(parser):
265265
help="Spawn vtysh on all routers on test failure",
266266
)
267267

268+
parser.addoption(
269+
"--ignore-backtraces",
270+
action="store_true",
271+
help="Ignore backtrace detection during test execution",
272+
)
273+
268274

269275
def check_for_valgrind_memleaks():
270276
assert topotest.g_pytest_config.option.valgrind_memleaks
@@ -469,7 +475,8 @@ def pytest_runtest_call(item: pytest.Item) -> None:
469475
# Let the default pytest_runtest_call execute the test function
470476
yield
471477

472-
check_for_backtraces()
478+
if not item.config.option.ignore_backtraces:
479+
check_for_backtraces()
473480
check_for_core_dumps()
474481

475482
# Check for leaks if requested

0 commit comments

Comments
 (0)