From f58d376b3ade03a77d3029879d00ce2f1918726b Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 11 Sep 2026 20:55:14 +0100 Subject: [PATCH] Add an option to the logger to immediately fatal on first error * This is mostly useful for some of the tests that want to be able to run and accumulate multiple errors, but while debugging we want an exception to catch. --- util/test/rdtest/logging.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/test/rdtest/logging.py b/util/test/rdtest/logging.py index 09e023010..36faca842 100644 --- a/util/test/rdtest/logging.py +++ b/util/test/rdtest/logging.py @@ -32,6 +32,7 @@ class TestLogger: self.ctx_callback: Callable[[], None] | None = None self.outputs: List[IO[str]] = [sys.stdout] self.failed = False + self.fast_fail = False self.section_failed = False self.logged_exception = False self.mutex = threading.Lock() @@ -158,6 +159,9 @@ class TestLogger: self.rawprint("!! " + message) + if self.fast_fail: + raise TestFailureException("Forcing failure") + def failure(self, ex: Exception): if self.logged_exception: return