Skip to content

Commit

Permalink
fixup: Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
maru-ava committed Nov 19, 2024
1 parent cfe1113 commit 4635785
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/antithesis/avalanchego/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 1 addition & 7 deletions tests/simple_test_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -98,7 +93,6 @@ func (tc *SimpleTestContext) RecoverAndExit() {
}

if panicDuringCleanup := tc.cleanup(); panicDuringCleanup {
// Exit non-zero if a panic occurred during cleanup
exitNonZero = true
}

Expand Down

0 comments on commit 4635785

Please sign in to comment.