Skip to content

Commit e93fcfe

Browse files
authored
fix: fix prometheus reporter test (#624)
1 parent e3cfbf4 commit e93fcfe

File tree

1 file changed

+2
-3
lines changed
  • polaris-plugins/polaris-plugins-observability/stat-prometheus/src/test/java/com/tencent/polaris/plugins/stat/prometheus/plugin

1 file changed

+2
-3
lines changed

polaris-plugins/polaris-plugins-observability/stat-prometheus/src/test/java/com/tencent/polaris/plugins/stat/prometheus/plugin/PrometheusReporterTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,15 @@ public void testExpiredDataClean() throws InterruptedException {
105105
ServiceCallResult callResult = mockServiceCallResult();
106106
statInfo.setRouterGauge(callResult);
107107
batchDone(() -> handler.reportStat(statInfo), count);
108-
109108
// mock push
110109
LOG.info("first mock push finish...");
111-
Thread.sleep(pushInterval + 1000);
110+
Thread.sleep(pushInterval + 50);
112111
Double result = getServiceCallTotalResult(callResult);
113112
Assert.assertEquals(new Double(count), result);
114113

115114
// mock next push
116115
LOG.info("second mock push finish...");
117-
Thread.sleep(pushInterval + 1000);
116+
Thread.sleep(pushInterval + 50);
118117
result = getServiceCallTotalResult(callResult);
119118
Assert.assertEquals(new Double(0), result);
120119

0 commit comments

Comments
 (0)