This is an automated email from the ASF dual-hosted git repository.
joerghoh 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 306649b SLING-13245 improve resilience of the HistoryIT (#58)
306649b is described below
commit 306649b8d738443b00650af298d3c8f274d89b0b
Author: Jörg Hoh <[email protected]>
AuthorDate: Mon Jun 22 14:24:32 2026 +0200
SLING-13245 improve resilience of the HistoryIT (#58)
avoid having same timestamps for the jobs
---
src/test/java/org/apache/sling/event/it/HistoryIT.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/test/java/org/apache/sling/event/it/HistoryIT.java
b/src/test/java/org/apache/sling/event/it/HistoryIT.java
index a18eadd..2f1406f 100644
--- a/src/test/java/org/apache/sling/event/it/HistoryIT.java
+++ b/src/test/java/org/apache/sling/event/it/HistoryIT.java
@@ -53,6 +53,9 @@ public class HistoryIT extends AbstractJobHandlingIT {
private static final String PROP_COUNTER = "counter";
+ // Processing delay per job.
+ private static final long JOB_PROCESSING_DELAY_MS = 50L;
+
@Configuration
public Option[] configuration() {
return options(
@@ -90,7 +93,7 @@ public class HistoryIT extends AbstractJobHandlingIT {
@Override
public JobExecutionResult process(final Job job, final
JobExecutionContext context) {
- sleep(5L);
+ sleep(JOB_PROCESSING_DELAY_MS);
final long count = job.getProperty(PROP_COUNTER, Long.class);
if (count == 2 || count == 5 || count == 7) {
return
context.result().message(Job.JobState.ERROR.name()).cancelled();
@@ -103,7 +106,6 @@ public class HistoryIT extends AbstractJobHandlingIT {
for (int i = 0; i < 10; i++) {
this.addJob(i);
}
- this.sleep(200L);
while (jobManager
.findJobs(JobManager.QueryType.HISTORY, TOPIC, -1,
(Map<String, Object>[]) null)
.size()