Skip to content

Commit

Permalink
Add small delay between ws connections (#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge authored Feb 8, 2023
1 parent 542b8a1 commit b963d4f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import org.http4s.websocket.WebSocketFrame
import org.typelevel.ci._
import scodec.bits.ByteVector

import scala.concurrent.duration._

class JdkWSClientSpec extends CatsEffectSuite {

val webSocket: IOFixture[WSClient[IO]] =
Expand Down Expand Up @@ -149,6 +151,7 @@ class JdkWSClientSpec extends CatsEffectSuite {
.map(s => WSRequest(httpToWsUri(s.baseUri)))
_ <- server.use { req =>
webSocket().connect(req).use(conn => conn.send(WSFrame.Text("hi ember"))) *>
IO.sleep(100.millis) *> // quick sleep to collect the close frame
webSocket().connectHighLevel(req).use { conn =>
conn.send(WSFrame.Text("hey ember"))
}
Expand Down

0 comments on commit b963d4f

Please sign in to comment.