Skip to content

Commit

Permalink
fix flapping test
Browse files Browse the repository at this point in the history
GitOrigin-RevId: b3a2a99f3842bf4d1e5d6be54a3a41b7f2d9224f
  • Loading branch information
Shastick committed Oct 22, 2019
1 parent 750064e commit 27d8375
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ class ThreadUnsafeDoubleUniformReservoirSpec extends FlatSpec with Matchers {
res.values shouldBe Array(1.0, 2.0)
}
it should "properly pass the real min and max to the snapshot" in {
new ThreadUnsafeDoubleUniformReservoir(2)
val snap = new ThreadUnsafeDoubleUniformReservoir(2)
.update(1.0)
.update(2.0)
.update(3.0)
.snapshot()
.shouldBe(Stats(1.0, 3.0, 2.0, 1.4142135623730951, 2.0))

snap.min shouldBe 1.0
snap.max shouldBe 3.0
}
it should "return a zero-snapshot if no value was sampled" in {
new ThreadUnsafeDoubleUniformReservoir(2)
Expand Down

0 comments on commit 27d8375

Please sign in to comment.