test(qr): wait for the client to close after the gateway cancels
This commit is contained in:
parent
c947abdf0e
commit
fca6ea5c1d
1 changed files with 4 additions and 0 deletions
|
|
@ -67,6 +67,10 @@ func serveGateway(t *testing.T, acks int) http.HandlerFunc {
|
|||
}
|
||||
if shown && acks <= 0 {
|
||||
_ = conn.WriteJSON(map[string]any{"op": "cancel"})
|
||||
// Closing first would fail the client's next heartbeat before it reads the cancel.
|
||||
for err == nil {
|
||||
_, _, err = conn.ReadMessage()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue