Skip to content

Commit

Permalink
cleanup test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
MetalBlueberry committed Dec 17, 2024
1 parent a4e1245 commit bb17609
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions pkg/csvcopy/csvcopy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,11 @@ func TestFailedBatchHandler(t *testing.T) {
wait.ForLog("database system is ready to accept connections").
WithOccurrence(2).WithStartupTimeout(5*time.Second)),
)
if err != nil {
t.Fatal(err)
}
require.NoError(t, err)

t.Cleanup(func() {
if err := pgContainer.Terminate(ctx); err != nil {
t.Fatalf("failed to terminate pgContainer: %s", err)
}
err := pgContainer.Terminate(ctx)
require.NoError(t, err)
})

connStr, err := pgContainer.ConnectionString(ctx, "sslmode=disable")
Expand Down Expand Up @@ -460,9 +457,8 @@ func TestFailedBatchHandlerFailure(t *testing.T) {
require.NoError(t, err)

t.Cleanup(func() {
if err := pgContainer.Terminate(ctx); err != nil {
t.Fatalf("failed to terminate pgContainer: %s", err)
}
err := pgContainer.Terminate(ctx)
require.NoError(t, err)
})

connStr, err := pgContainer.ConnectionString(ctx, "sslmode=disable")
Expand Down Expand Up @@ -496,7 +492,7 @@ func TestFailedBatchHandlerFailure(t *testing.T) {

for _, record := range data {
err := writer.Write(record)
require.NoError(t, err, "Error writing record to CSV")
require.NoError(t, err, "Error writing record to CSV")
}

writer.Flush()
Expand Down

0 comments on commit bb17609

Please sign in to comment.