Skip to content

Commit

Permalink
Fix test: testNeedBrokerDataUpdate loadReport considers absolute perc…
Browse files Browse the repository at this point in the history
…entage change only (apache#464)
  • Loading branch information
rdhabalia authored Jun 9, 2017
1 parent 70abe6d commit 0d0c9ed
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,18 @@ public void testNeedBrokerDataUpdate() throws Exception {
lastData.setMsgRateIn(0);
assert (!needUpdate.get());

// Minimally test other values to ensure they are included.
// Minimally test other absolute values to ensure they are included.
lastData.getCpu().usage = 100;
lastData.getCpu().limit = 1000;
currentData.getCpu().usage = 106;
currentData.getCpu().limit = 1000;
assert (!needUpdate.get());

// Minimally test other absolute values to ensure they are included.
lastData.getCpu().usage = 100;
lastData.getCpu().limit = 1000;
currentData.getCpu().usage = 206;
currentData.getCpu().limit = 1000;
assert (needUpdate.get());

lastData.setCpu(new ResourceUsage());
Expand Down

0 comments on commit 0d0c9ed

Please sign in to comment.