Skip to content

Commit

Permalink
test: improve reliability of mockwebserver websocket test
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa committed Aug 29, 2024
1 parent 75dc347 commit 3dabd69
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,12 @@ class DefaultMockServerWebSocketTest extends Specification {
.addSubProtocol("v4.channel.k8s.io"))
and: "A WebSocket listener"
wsReq.onComplete { ws ->
future.complete(ws.result().headers().get("sec-websocket-protocol"))
if (ws.result() != null && ws.result().headers() != null) {
future.complete(ws.result().headers().get("sec-websocket-protocol"))
}
}
if (wsReq.result() != null && wsReq.result().headers() != null) {
future.complete(wsReq.result().headers().get("sec-websocket-protocol"))
}
and: "An instance of AsyncConditions"
def async = new AsyncConditions(1)
Expand Down

0 comments on commit 3dabd69

Please sign in to comment.