Skip to content

Commit

Permalink
Clean up resources in correct order
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris S. Kim committed Feb 23, 2023
1 parent 6f98802 commit aa13f2b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions agent/xds/xds_protocol_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ func newTestServerDeltaScenario(
) *testServerScenario {
mgr := newTestManager(t)
envoy := NewTestEnvoy(t, proxyID, token)
t.Cleanup(func() {
envoy.Close()
})

sink := metrics.NewInmemSink(1*time.Minute, 1*time.Minute)
cfg := metrics.DefaultConfig("consul.xds.test")
Expand All @@ -177,6 +174,7 @@ func newTestServerDeltaScenario(
metrics.NewGlobal(cfg, sink)

t.Cleanup(func() {
envoy.Close()
sink := &metrics.BlackholeSink{}
metrics.NewGlobal(cfg, sink)
})
Expand Down

0 comments on commit aa13f2b

Please sign in to comment.