From 46357858a623f587fc55c45f36f92114d28b5b69 Mon Sep 17 00:00:00 2001 From: Maru Newby <maru.newby@avalabs.org> Date: Tue, 19 Nov 2024 19:40:23 +0100 Subject: [PATCH] fixup: Minor cleanup --- tests/antithesis/avalanchego/main.go | 2 +- tests/simple_test_context.go | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/antithesis/avalanchego/main.go b/tests/antithesis/avalanchego/main.go index 30abf45ec350..eee7edb05b39 100644 --- a/tests/antithesis/avalanchego/main.go +++ b/tests/antithesis/avalanchego/main.go @@ -163,7 +163,7 @@ func (w *workload) run(ctx context.Context) { defer tc.Recover(true /* rethrow */) xAVAX, pAVAX := e2e.GetWalletBalances(tc, w.wallet) - tc.Outf("wallet starting with %d X-chain nAVAX and %d P-chain nAVAX", w.id, xAVAX, pAVAX) + tc.Outf("wallet starting with %d X-chain nAVAX and %d P-chain nAVAX", xAVAX, pAVAX) assert.Reachable("wallet starting", map[string]any{ "worker": w.id, "xBalance": xAVAX, diff --git a/tests/simple_test_context.go b/tests/simple_test_context.go index 3a78621d498a..654af9aa9ed3 100644 --- a/tests/simple_test_context.go +++ b/tests/simple_test_context.go @@ -73,11 +73,6 @@ func (*SimpleTestContext) GetWriter() io.Writer { // cleanup functions are called before exit or re-panic (in the event // of an unexpected panic or a panic during cleanup). func (tc *SimpleTestContext) RecoverAndExit() { - if tc.cleanupCalled { - return - } - tc.cleanupCalled = true - // Only exit non-zero if a cleanup caused a panic exitNonZero := false @@ -89,7 +84,7 @@ func (tc *SimpleTestContext) RecoverAndExit() { if tc.panicHandler != nil { tc.panicHandler(r) } - // Retain the panic data to raise after cleanup in the event that the panic was not due to FailNow + // Retain the panic data to raise after cleanup panicData = r } else { // Ensure a non-zero exit due to an assertion failure @@ -98,7 +93,6 @@ func (tc *SimpleTestContext) RecoverAndExit() { } if panicDuringCleanup := tc.cleanup(); panicDuringCleanup { - // Exit non-zero if a panic occurred during cleanup exitNonZero = true }