Skip to content

Commit

Permalink
Ratchet down the error rate to +/- 5%; tests fail
Browse files Browse the repository at this point in the history
  • Loading branch information
David McGuire committed Apr 17, 2015
1 parent 24b1bc0 commit 38f3ca8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,16 @@ class ReceiverSuite extends TestSuiteBase with Timeouts with Serializable {

// recordedData size should be close to the expected rate
// use an error margin proportional to the value, so that rate changes don't cause a brittle test
val minExpectedMessages = expectedMessages - 0.3 * expectedMessages
val maxExpectedMessages = expectedMessages + 0.1 * expectedMessages
val minExpectedMessages = expectedMessages - 0.05 * expectedMessages
val maxExpectedMessages = expectedMessages + 0.05 * expectedMessages
val numMessages = recordedData.size
assert(
numMessages >= minExpectedMessages && numMessages <= maxExpectedMessages,
s"#records received = $numMessages, not between $minExpectedMessages and $maxExpectedMessages"
)

val minExpectedMessagesPerBlock = expectedMessagesPerBlock - 0.3 * expectedMessagesPerBlock
val maxExpectedMessagesPerBlock = expectedMessagesPerBlock + 0.1 * expectedMessagesPerBlock
val minExpectedMessagesPerBlock = expectedMessagesPerBlock - 0.05 * expectedMessagesPerBlock
val maxExpectedMessagesPerBlock = expectedMessagesPerBlock + 0.05 * expectedMessagesPerBlock
val receivedBlockSizes = recordedBlocks.map { _.size }.mkString(",")
assert(
// the first and last block may be incomplete, so we slice them out
Expand Down

0 comments on commit 38f3ca8

Please sign in to comment.