simplify output of handshake RTT tests when the test fails

This commit is contained in:
Marten Seemann
2018-08-15 16:12:25 +07:00
parent 0eede57a2d
commit 3168f6cd28

View File

@@ -65,10 +65,10 @@ var _ = Describe("Handshake RTT tests", func() {
expectDurationInRTTs := func(num int) {
testDuration := time.Since(testStartedAt)
expectedDuration := time.Duration(num) * rtt
Expect(testDuration).To(SatisfyAll(
BeNumerically(">=", expectedDuration),
BeNumerically("<", expectedDuration+rtt),
rtts := float32(testDuration) / float32(rtt)
Expect(rtts).To(SatisfyAll(
BeNumerically(">=", num),
BeNumerically("<", num+1),
))
}