Skip to content

Commit

Permalink
testing: Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Apr 1, 2024
1 parent 474a323 commit a4d48d7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ func (c *ClientRaw) Close() error {
if c == nil {
return nil
}
defer close(c.Messages)

c.sendMu.Lock()
defer c.sendMu.Unlock()
Expand All @@ -238,10 +237,8 @@ func (c *ClientRaw) Close() error {
return ErrShutdown
}
c.closing = true

err := c.conn.Close()

return err
close(c.Messages)
return c.conn.Close()
}

// Execute sends body to the server and sends any messages to the messages channel.
Expand Down

0 comments on commit a4d48d7

Please sign in to comment.