File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed
io/shared/src/test/scala/fs2/io/net/tcp Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ class SocketSuite extends Fs2Suite with SocketSuitePlatform {
225225 }
226226 }
227227
228- test(" read after timed out read not allowed on JVM or Native " .ignore ) {
228+ test(" read after timed out read" ) {
229229 val setup = for {
230230 serverSetup <- Network [IO ].serverResource(Some (ip " 127.0.0.1 " ))
231231 (bindAddress, server) = serverSetup
@@ -239,22 +239,10 @@ class SocketSuite extends Fs2Suite with SocketSuitePlatform {
239239 val prg =
240240 client.write(msg) *>
241241 client.readN(msg.size) *>
242- client.readN(msg.size).timeout(100 .millis).recover { case _ : TimeoutException =>
243- Chunk .empty
244- } *>
242+ (client.readN(msg.size) *> IO .raiseError(new AssertionError (" didn't timeout" )))
243+ .timeoutTo(100 .millis, IO .unit) *>
245244 client.write(msg) *>
246- client
247- .readN(msg.size)
248- .flatMap { c =>
249- if (isJVM) {
250- assertEquals(c.size, 0 )
251- // Read again now that the pending read is no longer pending
252- client.readN(msg.size).map(c => assertEquals(c.size, 0 ))
253- } else {
254- assertEquals(c, msg)
255- IO .unit
256- }
257- }
245+ client.readN(msg.size).flatMap(c => IO (assertEquals(c, msg)))
258246 Stream .eval(prg).concurrently(echoServer)
259247 }
260248 .compile
You can’t perform that action at this time.
0 commit comments