We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d666053 commit 6c0ff81Copy full SHA for 6c0ff81
streaming/src/test/scala/org/apache/spark/streaming/util/RateLimitedOutputStreamSuite.scala
@@ -36,8 +36,9 @@ class RateLimitedOutputStreamSuite extends FunSuite {
36
val stream = new RateLimitedOutputStream(underlying, desiredBytesPerSec = 10000)
37
val elapsedNs = benchmark { stream.write(data.getBytes("UTF-8")) }
38
39
- // We accept anywhere from 4.0 to 4.99999 seconds since the value is rounded down.
40
- assert(SECONDS.convert(elapsedNs, NANOSECONDS) === 4)
+ val seconds = SECONDS.convert(elapsedNs, NANOSECONDS)
+ assert(seconds >= 4, s"Seconds value ($seconds) is less than 4.")
41
+ assert(seconds <= 30, s"Took more than 30 seconds ($seconds) to write data.")
42
assert(underlying.toString("UTF-8") === data)
43
}
44
0 commit comments