attempted fix of a flaky ClientWebSocketAdapter test (#3114)
### Change Type - [x] `tests` — Changes to any test code only
This commit is contained in:
parent
5e54526776
commit
19a1d01b8e
1 changed files with 3 additions and 0 deletions
|
@ -65,6 +65,9 @@ describe(ClientWebSocketAdapter, () => {
|
|||
const prevServerSocket = connectedServerSocket
|
||||
prevServerSocket.terminate()
|
||||
await waitFor(() => connectedServerSocket !== prevServerSocket)
|
||||
// there is a race here, the server could've opened a new socket already, but it hasn't
|
||||
// transitioned to OPEN yet, thus the second waitFor
|
||||
await waitFor(() => connectedServerSocket.readyState === WebSocket.OPEN)
|
||||
expect(adapter._ws).not.toBe(prevClientSocket)
|
||||
expect(adapter._ws?.readyState).toBe(WebSocket.OPEN)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue