Skip to content

Commit

Permalink
PM-3323: Clear logs between tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Jul 26, 2021
1 parent 93ea249 commit 32ce80d
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -136,6 +136,9 @@ object RobotCompositionSpec {
val env = Env(comp.logTracer)
comp.compose(opts, config).as(env)
}.sequence
_ <- Resource.pure[Task, Unit](()).onFinalize {
nodeEnvs.traverse(_.logTracer.clear).void
}
} yield nodeEnvs

def makeComposition(scheduler: TestScheduler) =
Expand All @@ -144,6 +147,11 @@ object RobotCompositionSpec {

// Every node has its own composer, so we can track logs separately.
class TestComposition(scheduler: TestScheduler) extends RobotComposition {

/** Class level log collector.
*
* If the composer is reused, this should be cleared between tests.
*/
val logTracer = InMemoryLogTracer.hybrid[Task]

private def makeLogTracer[T: HybridLog] =
Expand Down

0 comments on commit 32ce80d

Please sign in to comment.