From c250a3fe5e458fadddb38d22f558c8a2882fa6dd Mon Sep 17 00:00:00 2001 From: Zipeng WU Date: Wed, 18 Oct 2023 10:28:31 +0200 Subject: [PATCH] SONAR-20792 Fix flaky ShowActionIT.show_project_setting test --- .../org/sonar/server/newcodeperiod/ws/ShowActionIT.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java index 390e3fd007d..b2874ce70a5 100644 --- a/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java +++ b/server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java @@ -131,13 +131,11 @@ public class ShowActionIT { public void show_project_setting() { ProjectDto project = db.components().insertPublicProject().getProjectDto(); logInAsProjectAdministrator(project); - var currentTime = System.currentTimeMillis(); - tester.insert(new NewCodePeriodDto() + var ncd = tester.insert(new NewCodePeriodDto() .setProjectUuid(project.getUuid()) .setType(NewCodePeriodType.NUMBER_OF_DAYS) .setPreviousNonCompliantValue("100") - .setUpdatedAt(currentTime) .setValue("90")); ShowWSResponse response = ws.newRequest() @@ -145,7 +143,7 @@ public class ShowActionIT { .executeProtobuf(ShowWSResponse.class); assertResponse(response, project.getKey(), "", NUMBER_OF_DAYS, "90", false, "100"); - assertUpdatedAt(response, currentTime); + assertUpdatedAt(response, ncd.getUpdatedAt()); } @Test -- 2.39.5