fix race condition when trying to assert closed channel on the server side
This commit is contained in:
parent
54c3d77db2
commit
e853a1d2ae
1 changed files with 3 additions and 0 deletions
|
|
@ -161,6 +161,8 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
|
|||
closeCommander.expectMsg(Closed)
|
||||
assertThisConnectionActorTerminated()
|
||||
|
||||
nioSelector.select(2000)
|
||||
|
||||
val buffer = ByteBuffer.allocate(1)
|
||||
serverSideChannel.read(buffer) must be(-1)
|
||||
}
|
||||
|
|
@ -207,6 +209,7 @@ class TcpConnectionSpec extends AkkaSpec("akka.io.tcp.register-timeout = 500ms")
|
|||
connectionHandler.expectNoMsg(100.millis) // not yet
|
||||
|
||||
val buffer = ByteBuffer.allocate(1)
|
||||
nioSelector.select(2000)
|
||||
serverSideChannel.read(buffer) must be(-1)
|
||||
serverSideChannel.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue