Skip to content

Commit

Permalink
Fix random ut falling in DubboMonitorTest (apache#3327)
Browse files Browse the repository at this point in the history
  • Loading branch information
biyuhao authored and ralf0131 committed Jan 24, 2019
1 parent c72708b commit 4fbdc4f
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,23 @@ public void testCount() throws Exception {
.addParameter(MonitorService.CONCURRENT, 1)
.addParameter(MonitorService.MAX_CONCURRENT, 1);
monitor.collect(statistics);
monitor.send();
while (lastStatistics == null) {
Thread.sleep(10);
}
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.APPLICATION), "morgan");
Assertions.assertEquals(lastStatistics.getProtocol(), "dubbo");
Assertions.assertEquals(lastStatistics.getHost(), "10.20.153.10");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.APPLICATION), "morgan");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.INTERFACE), "MemberService");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.METHOD), "findPerson");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.CONSUMER), "10.20.153.11");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.SUCCESS), "1");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.FAILURE), "0");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.ELAPSED), "3");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.MAX_ELAPSED), "3");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.CONCURRENT), "1");
Assertions.assertEquals(lastStatistics.getParameter(MonitorService.MAX_CONCURRENT), "1");
Assertions.assertEquals("morgan", lastStatistics.getParameter(MonitorService.APPLICATION));
Assertions.assertEquals("dubbo", lastStatistics.getProtocol());
Assertions.assertEquals("10.20.153.10", lastStatistics.getHost());
Assertions.assertEquals("morgan", lastStatistics.getParameter(MonitorService.APPLICATION));
Assertions.assertEquals("MemberService", lastStatistics.getParameter(MonitorService.INTERFACE));
Assertions.assertEquals("findPerson", lastStatistics.getParameter(MonitorService.METHOD));
Assertions.assertEquals("10.20.153.11", lastStatistics.getParameter(MonitorService.CONSUMER));
Assertions.assertEquals("1", lastStatistics.getParameter(MonitorService.SUCCESS));
Assertions.assertEquals("0", lastStatistics.getParameter(MonitorService.FAILURE));
Assertions.assertEquals("3", lastStatistics.getParameter(MonitorService.ELAPSED));
Assertions.assertEquals("3", lastStatistics.getParameter(MonitorService.MAX_ELAPSED));
Assertions.assertEquals("1", lastStatistics.getParameter(MonitorService.CONCURRENT));
Assertions.assertEquals("1", lastStatistics.getParameter(MonitorService.MAX_CONCURRENT));
monitor.destroy();
}

Expand Down

0 comments on commit 4fbdc4f

Please sign in to comment.