Skip to content

Commit

Permalink
terminate container only if running
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Hwang <[email protected]>
  • Loading branch information
sthwang-metal committed Oct 6, 2023
1 parent 139a4e1 commit b3a5cc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/manualhooks/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func teardown(entClient *ent.Client, dbc *testcontainersx.DBContainer) {
testutils.IfErrPanic("teardown failed to close database connection", entClient.Close())
}

if dbc != nil {
if dbc != nil && dbc.Container.IsRunning() {
testutils.IfErrPanic("teardown failed to terminate test db container", dbc.Container.Terminate(ctx))
}
}
Expand Down

0 comments on commit b3a5cc4

Please sign in to comment.