Skip to content

Commit

Permalink
chore(pulsar): create/remove the network properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Sep 11, 2023
1 parent d6c4221 commit 9235361
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/pulsar/pulsar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestPulsar(t *testing.T) {
defer cancel()

nwName := "pulsar-test"
_, err := testcontainers.GenericNetwork(ctx, testcontainers.GenericNetworkRequest{
nw, err := testcontainers.GenericNetwork(context.Background(), testcontainers.GenericNetworkRequest{
NetworkRequest: testcontainers.NetworkRequest{
Name: nwName,
},
Expand Down Expand Up @@ -211,4 +211,11 @@ func TestPulsar(t *testing.T) {
assert.True(t, ok)
})
}

// remove the network after the last, so that all containers are already removed
// and there are no active endpoints on the network
t.Cleanup(func() {
err := nw.Remove(context.Background())
require.NoError(t, err)
})
}

0 comments on commit 9235361

Please sign in to comment.