Skip to content

Commit

Permalink
Fix test assertion to be called. Fix array equality test for headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
misha authored and misha committed Jan 6, 2021
1 parent 440cfc6 commit 00cdf54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions scheduler/src/test/scala/com/sky/kms/e2e/SchedulerIntSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ class SchedulerIntSpec extends SchedulerIntSpecBase {
withSchedulerApp {
val schedules = createSchedules(2, forTopics = List(scheduleTopic, extraScheduleTopic))

publish(schedules) andThen
(assertMessagesWrittenFrom(_, schedules))
publish(schedules)
.foreach(assertMessagesWrittenFrom(_, schedules))

assertTombstoned(schedules)
}
}
Expand Down Expand Up @@ -48,7 +49,10 @@ class SchedulerIntSpec extends SchedulerIntSpecBase {
cr.key should contain theSameElementsInOrderAs schedule.key
cr.value should contain theSameElementsInOrderAs schedule.value.get
cr.timestamp shouldBe time.toInstant.toEpochMilli +- Tolerance.toMillis
cr.headers().toArray.map(h => h.key() -> h.value()).toMap should contain theSameElementsAs schedule.headers
cr.headers().toArray.map(h => h.key() -> h.value().toList) should contain theSameElementsAs
schedule.headers.map {
case (k, v) => (k, v.toList)
}
}

def assertTombstoned(schedules: List[(ScheduleId, ScheduleEvent)]): Unit =
Expand Down
2 changes: 1 addition & 1 deletion scheduler/src/test/scala/com/sky/kms/e2e/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import scala.concurrent.duration._

package object e2e {

val Tolerance = 200 millis
val Tolerance = 400 millis

def withSchedulerApp[T](
scenario: => T)(implicit conf: SchedulerConfig, system: ActorSystem, mat: ActorMaterializer): T =
Expand Down

0 comments on commit 00cdf54

Please sign in to comment.