Skip to content

Commit

Permalink
Adds a delay before checking the metrics (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedefernandez committed Jan 18, 2018
1 parent 74802f6 commit 48e08e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/common/src/test/scala/RpcBaseTestSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import org.scalatest.{Matchers, OneInstancePerTest, WordSpec}

trait RpcBaseTestSuite extends WordSpec with Matchers with OneInstancePerTest with MockFactory {

val sleepM: ConcurrentMonad[Unit] = delayM(Thread.sleep(500))

trait Helpers {

def runK[F[_], A, B](kleisli: Kleisli[F, A, B], v: A): F[B] =
Expand Down
2 changes: 2 additions & 0 deletions modules/common/src/test/scala/common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ package object common {

type ConcurrentMonad[A] = IO[A]

def delayM[A](a: A): ConcurrentMonad[A] = IO(a)

}
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ abstract class BaseMonitorClientInterceptorTests extends RpcBaseTestSuite {
(for {
_ <- serverStart[ConcurrentMonad]
_ <- clientProgram[ConcurrentMonad]
_ <- sleepM
_ <- check1[ConcurrentMonad]
_ <- clientProgram2[ConcurrentMonad]
_ <- sleepM
_ <- check2[ConcurrentMonad]
_ <- serverStop[ConcurrentMonad]
} yield (): Unit).unsafeRunSync()
Expand Down Expand Up @@ -296,6 +298,7 @@ abstract class BaseMonitorClientInterceptorTests extends RpcBaseTestSuite {
_ <- serverStart[ConcurrentMonad]
_ <- unary[ConcurrentMonad]
_ <- clientStreaming[ConcurrentMonad]
_ <- sleepM
_ <- serverStop[ConcurrentMonad]
} yield (): Unit).unsafeRunSync()

Expand Down

0 comments on commit 48e08e3

Please sign in to comment.