HDFS-9772. TestBlockReplacement#testThrottler doesn't work as expected. Contributed by Lin Yiqun.

This commit is contained in:
Walter Su 2016-04-13 17:49:45 +08:00
parent 35f0770555
commit 903428bf94
1 changed files with 1 additions and 2 deletions

View File

@ -81,7 +81,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;
@ -93,7 +92,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