Skip to content

Commit

Permalink
ADM-794:[backend]fix: repair test to add sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
yulongcai committed Feb 1, 2024
1 parent 5cb1dfc commit 2696ae6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void ShouldInitializeMetricsDataCompletedInHandlerWithPreOneWhenPreOneExisted()
}

@Test
void ShouldInitializeMetricsDataCompletedInHandlerWhenRequestMetricsExist() {
void ShouldInitializeMetricsDataCompletedInHandlerWhenRequestMetricsExist() throws InterruptedException {
MetricsDataCompleted expectMetricsDataResult = MetricsDataCompleted.builder()
.boardMetricsCompleted(false)
.pipelineMetricsCompleted(true)
Expand All @@ -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);
Expand Down

0 comments on commit 2696ae6

Please sign in to comment.