Skip to content

Commit

Permalink
usm: kafka: tests: Improve cleanup to solve flakiness (#26225)
Browse files Browse the repository at this point in the history
  • Loading branch information
guyarb authored Jun 3, 2024
1 parent d31dc90 commit d3371d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/network/usm/kafka_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,11 @@ func (can *CannedClientServer) runServer() {
})

go func() {
defer f.Close()
defer listener.Close()
defer func() {
listener.Close()
f.Close()
can.done <- true
}()

conn, err := listener.Accept()
require.NoError(can.t, err)
Expand Down Expand Up @@ -891,8 +894,6 @@ func (can *CannedClientServer) runServer() {
if prevconn != nil {
prevconn.Close()
}

can.done <- true
}()
}

Expand Down

0 comments on commit d3371d7

Please sign in to comment.