Skip to content

Commit

Permalink
Merge pull request #42 from Danconnolly/test-timeout
Browse files Browse the repository at this point in the history
Add timeout to test so it fails instead of getting stuck.
  • Loading branch information
Danconnolly committed Apr 29, 2023
2 parents 633e982 + 5dd2d26 commit dbf2f28
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ class ConnectionHandlerTest extends Specification {
*/
def "testing Server-Client Connection OK"() {
given:
// Each Connection Handler will run on one specific Thread.
ExecutorService serverExecutor = ThreadUtils.getSingleThreadExecutorService("Server-EventBus-")
ExecutorService clientExecutor = ThreadUtils.getSingleThreadExecutorService("Client-EventBus-")

// Basic Configuration is the same for both of them...
RuntimeConfig runtimeConfig = new RuntimeConfigDefault()
runtimeConfig = runtimeConfig.toBuilder()
Expand Down Expand Up @@ -139,11 +135,12 @@ class ConnectionHandlerTest extends Specification {

client.start()
client.openConnection(PeerAddress.fromIp("127.0.0.1:8100")) // dummy port
failureLatch.await()
boolean failed = failureLatch.await(5, TimeUnit.SECONDS)
client.initiateStop()
client.awaitStopped()

then:
failed
clientRejected.get()
}

Expand Down

0 comments on commit dbf2f28

Please sign in to comment.