authorgravatar for techcable@techcable.netTechcable <techcable@techcable.net> 2022-08-22 04:38:03-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-08-22 14:38:03+03:00
log1a32f2a7f40328799537cc94240a57054a1275bc
tree0bd21f4ede2338f4b7adeba20d0e16c1f739413a
parent8667d6d61e8217159377c0e22bc35075848d1202
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

test_runner: workaround #1923, isolating error traces in tests

Essentially #1923 means "caught" errors still show up in error return traces. The correct fix would require the compiler to fix this, but that could affect performance. For now, simply workaround this issue by clearing the return traces between tests. This means that "caught" errors in one test will not show up in the error traces of other tests.

1 files changed, 7 insertions(+), 0 deletions(-)

lib/test_runner.zig+7
......@@ -96,6 +96,13 @@ pub fn main() void {
9696 test_node.end();
9797 },
9898 }
99 // Workaround issue #1923 by clearing error stack traces between tests
100 //
101 // This is not a true fix, but helps isolate errors to the tests where they
102 // originate instead of confusing them all together
103 if (@errorReturnTrace()) |trace| {
104 trace.index = 0;
105 }
99106 }
100107 root_node.end();
101108 if (ok_count == test_fn_list.len) {