Skip to content

Commit e99c651

Browse files
committed
Resolve masking of issues from failing to shutdown tests.
1 parent d972fc3 commit e99c651

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test_util_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ func createTempZipArchive() (string, func()) {
6161
}
6262

6363
func shutdownDBAndFail(t *testing.T, err error, db *EmbeddedPostgres) {
64-
if err := db.Stop(); err != nil {
65-
t.Fatalf("Failed for version %s with error %s", db.config.version, err)
64+
if db.started {
65+
if stopErr := db.Stop(); stopErr != nil {
66+
t.Errorf("Failed to shutdown server with error %s", stopErr)
67+
}
6668
}
67-
68-
t.Fatalf("Failed for version %s with error %s", db.config.version, err)
69+
t.Errorf("Failed for version %s with error %s", db.config.version, err)
6970
}
7071

7172
func testVersionStrategy() VersionStrategy {

0 commit comments

Comments
 (0)