Skip to content
Permalink
Browse files

Fixing unstable test

  • Loading branch information...
atooni committed Jul 11, 2019
1 parent d3f6494 commit 888f8ed45d4af282497ac88ed11b53d837dfa92c
@@ -4,7 +4,7 @@ jobs:
shell: /bin/sh -leo pipefail
working_directory: ~/blended
docker:
- image: atooni/build-alpine:0.1
- image: atooni/build-alpine:1.0
user: blended
steps:
- checkout
@@ -149,7 +149,9 @@ abstract class JMSPingPerformerSpec extends TestKit(ActorSystem("JMSPingPerforme

"does not leak threads on successful pings" in {

val src = Source(1.to(bulkCount)).map { i : Int =>
val threads : Int = threadCount()

val src = Source(1.to(bulkCount)).map { _ : Int =>
execPing(PingExecute(
count = counter.incrementAndGet(),
con = con.get,
@@ -161,32 +163,34 @@ abstract class JMSPingPerformerSpec extends TestKit(ActorSystem("JMSPingPerforme

assert(Await.result(result, bulkTimeout))
Thread.sleep(10000)
assert(threadCount() <= 100)
assert(threadCount() <= threads + 128)
}

"does not leak threads on failed ping inits" in {

pending
// TODO: Review
// val src = Source(1.to(bulkCount)).map { i: Int =>
// execPing(PingExecute(
// count = counter.incrementAndGet(),
// con = con.get,
// cfg = cfg.copy(clientId = "jmsPing", pingDestination = s"topic:$pingTopic", pingTimeout = 50.millis),
// operations = timingOut
// ))(10.seconds)
// }
//
// val result = src.mapAsync(10)(i => i).runFold(true)((c, i) => c && i == PingTimeout)
//
// assert(Await.result(result, bulkTimeout * 2))
// Thread.sleep(10000)
// assert(threadCount() <= 100)
val threads : Int = threadCount()

val src = Source(1.to(bulkCount)).map { i: Int =>
execPing(PingExecute(
count = counter.incrementAndGet(),
con = con.get,
cfg = cfg.copy(clientId = "jmsPing", pingDestination = s"topic:$pingTopic", pingTimeout = 50.millis),
operations = timingOut
))(10.seconds)
}

val result = src.mapAsync(10)(i => i).runFold(true)((c, i) => c && i == PingTimeout)

assert(Await.result(result, bulkTimeout * 2))
Thread.sleep(10000)
assert(threadCount() <= threads + 128)
}

"does not leak threads on failed ping probes" in {

val src = Source(1.to(bulkCount)).map { i : Int =>
val threads : Int = threadCount()

val src = Source(1.to(bulkCount)).map { _ : Int =>
execPing(PingExecute(
count = counter.incrementAndGet(),
con = con.get,
@@ -202,7 +206,7 @@ abstract class JMSPingPerformerSpec extends TestKit(ActorSystem("JMSPingPerforme

assert(Await.result(result, bulkTimeout) === (0, bulkCount))
Thread.sleep(10000)
assert(threadCount() <= 100)
assert(threadCount() <= threads + 128)
}
}
}
@@ -4,7 +4,7 @@ status=published

== Build file structure

_Blended_ uses `sbt 1.2.6` to build. Currently we have a bit more than 60 submodules in _Blended_, so that the build
_Blended_ uses `sbt 1.2.8` to build. Currently we have a bit more than 60 submodules in _Blended_, so that the build
file structure needs a bit of explanation:

* The main build file ist `build.sbt` in the root directory of the checkout. The build file is augmented with `.scala` files in the `project`-directory.

0 comments on commit 888f8ed

Please sign in to comment.
You can’t perform that action at this time.