HDFS-9772. TestBlockReplacement#testThrottler doesn't work as expected. Contributed by Lin Yiqun.
(cherry picked from commit 903428bf946827b4d58c7c577ed0c574a7cff029)
This commit is contained in:
parent
3afdac6e2c
commit
2ee244ac28
@ -80,7 +80,6 @@ public void testThrottler() throws IOException {
|
||||
long bytesToSend = TOTAL_BYTES;
|
||||
long start = Time.monotonicNow();
|
||||
DataTransferThrottler throttler = new DataTransferThrottler(bandwidthPerSec);
|
||||
long totalBytes = 0L;
|
||||
long bytesSent = 1024*512L; // 0.5MB
|
||||
throttler.throttle(bytesSent);
|
||||
bytesToSend -= bytesSent;
|
||||
@ -92,7 +91,7 @@ public void testThrottler() throws IOException {
|
||||
} catch (InterruptedException ignored) {}
|
||||
throttler.throttle(bytesToSend);
|
||||
long end = Time.monotonicNow();
|
||||
assertTrue(totalBytes*1000/(end-start)<=bandwidthPerSec);
|
||||
assertTrue(TOTAL_BYTES * 1000 / (end - start) <= bandwidthPerSec);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user