From 2696ae6a15b99f780eab975cc25551d705a08334 Mon Sep 17 00:00:00 2001 From: yulongcai Date: Thu, 1 Feb 2024 14:41:19 +0800 Subject: [PATCH] ADM-794:[backend]fix: repair test to add sleep --- .../test/java/heartbeat/service/report/ReportServiceTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/test/java/heartbeat/service/report/ReportServiceTest.java b/backend/src/test/java/heartbeat/service/report/ReportServiceTest.java index f00fb67047..563045ea5d 100644 --- a/backend/src/test/java/heartbeat/service/report/ReportServiceTest.java +++ b/backend/src/test/java/heartbeat/service/report/ReportServiceTest.java @@ -110,7 +110,7 @@ void ShouldInitializeMetricsDataCompletedInHandlerWithPreOneWhenPreOneExisted() } @Test - void ShouldInitializeMetricsDataCompletedInHandlerWhenRequestMetricsExist() { + void ShouldInitializeMetricsDataCompletedInHandlerWhenRequestMetricsExist() throws InterruptedException { MetricsDataCompleted expectMetricsDataResult = MetricsDataCompleted.builder() .boardMetricsCompleted(false) .pipelineMetricsCompleted(true) @@ -124,6 +124,7 @@ void ShouldInitializeMetricsDataCompletedInHandlerWhenRequestMetricsExist() { .thenReturn(MetricsDataCompleted.builder().pipelineMetricsCompleted(true).build()); doAnswer(invocation -> null).when(generateReporterService).generateBoardReport(request); + Thread.sleep(100); reportService.generateReportByType(request, MetricType.BOARD); verify(asyncMetricsDataHandler).putMetricsDataCompleted("csvTimeStamp", expectMetricsDataResult);