This is an automated email from the ASF dual-hosted git repository.

stefanegli pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git


The following commit(s) were added to refs/heads/master by this push:
     new d166867  SLING-12078 : adding 2sec delays as workaround to 
TOPOLOGY_INIT/addJob race condition
d166867 is described below

commit d16686705908099b26d0a3233f61c4e209880f93
Author: Stefan Egli <[email protected]>
AuthorDate: Thu Oct 5 16:37:57 2023 +0200

    SLING-12078 : adding 2sec delays as workaround to TOPOLOGY_INIT/addJob race 
condition
---
 src/test/java/org/apache/sling/event/it/ClassloadingIT.java | 6 ++++++
 src/test/java/org/apache/sling/event/it/JobHandlingIT.java  | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/src/test/java/org/apache/sling/event/it/ClassloadingIT.java 
b/src/test/java/org/apache/sling/event/it/ClassloadingIT.java
index 2214ab3..6de9b39 100644
--- a/src/test/java/org/apache/sling/event/it/ClassloadingIT.java
+++ b/src/test/java/org/apache/sling/event/it/ClassloadingIT.java
@@ -35,6 +35,7 @@ import org.apache.sling.event.jobs.NotificationConstants;
 import org.apache.sling.event.jobs.QueueConfiguration;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
 import org.apache.sling.testing.tools.retry.RetryLoop;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
@@ -74,6 +75,11 @@ public class ClassloadingIT extends AbstractJobHandlingIT {
         );
     }
 
+    @Before
+    public void additionalStartupDelay() throws InterruptedException {
+        Thread.sleep(2000);
+    }
+
     @Test(timeout = DEFAULT_TEST_TIMEOUT)
     public void testSimpleClassloading() throws Exception {
         final AtomicInteger processedJobsCount = new AtomicInteger(0);
diff --git a/src/test/java/org/apache/sling/event/it/JobHandlingIT.java 
b/src/test/java/org/apache/sling/event/it/JobHandlingIT.java
index d8abbca..dc2d6da 100644
--- a/src/test/java/org/apache/sling/event/it/JobHandlingIT.java
+++ b/src/test/java/org/apache/sling/event/it/JobHandlingIT.java
@@ -47,6 +47,7 @@ import org.apache.sling.event.jobs.consumer.JobConsumer;
 import org.apache.sling.event.jobs.consumer.JobExecutionContext;
 import org.apache.sling.event.jobs.consumer.JobExecutionResult;
 import org.apache.sling.event.jobs.consumer.JobExecutor;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
@@ -82,6 +83,11 @@ public class JobHandlingIT extends AbstractJobHandlingIT {
         );
     }
 
+    @Before
+    public void additionalStartupDelay() throws InterruptedException {
+        Thread.sleep(2000);
+    }
+
     /**
      * Test simple job execution.
      * The job is executed once and finished successfully.

Reply via email to