diff options
author | Aurelien Poscia <aurelien.poscia@sonarsource.com> | 2022-11-04 13:47:21 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-11-04 20:03:11 +0000 |
commit | 717613ac072b0cb9b49fff79354b99f26060be72 (patch) | |
tree | 03968686e94f512de18f2e3b5f4da3d594c7c407 /server/sonar-webserver-pushapi/src/main | |
parent | b7d4912784b1cb6a4a03740368b9dc8232c979aa (diff) | |
download | sonarqube-717613ac072b0cb9b49fff79354b99f26060be72.tar.gz sonarqube-717613ac072b0cb9b49fff79354b99f26060be72.zip |
NO-JIRA replace un-necessary and flaky expired_push_events_are_purged_on_schedule IT by predictable junit
Diffstat (limited to 'server/sonar-webserver-pushapi/src/main')
-rw-r--r-- | server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/scheduler/purge/PushEventsPurgeScheduler.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/scheduler/purge/PushEventsPurgeScheduler.java b/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/scheduler/purge/PushEventsPurgeScheduler.java index e1ccf7e1458..0d582e57135 100644 --- a/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/scheduler/purge/PushEventsPurgeScheduler.java +++ b/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/scheduler/purge/PushEventsPurgeScheduler.java @@ -19,6 +19,7 @@ */ package org.sonar.server.pushapi.scheduler.purge; +import com.google.common.annotations.VisibleForTesting; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.Set; @@ -38,8 +39,12 @@ import static java.util.concurrent.TimeUnit.SECONDS; public class PushEventsPurgeScheduler implements Startable { private static final Logger LOG = Loggers.get(PushEventsPurgeScheduler.class); private static final String LOCK_NAME = "PushPurgeCheck"; - private static final String INITIAL_DELAY_IN_SECONDS = "sonar.push.events.purge.initial.delay"; - private static final String ENQUEUE_DELAY_IN_SECONDS = "sonar.push.events.purge.enqueue.delay"; + + @VisibleForTesting + static final String INITIAL_DELAY_IN_SECONDS = "sonar.push.events.purge.initial.delay"; + @VisibleForTesting + static final String ENQUEUE_DELAY_IN_SECONDS = "sonar.push.events.purge.enqueue.delay"; + private static final int ENQUEUE_LOCK_DELAY_IN_SECONDS = 60; private final DbClient dbClient; |