You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2023/06/27 12:19:41 UTC
[sling-org-apache-sling-testing-osgi-mock] branch issue/SLING-11916 created (now 2306085)
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a change to branch issue/SLING-11916
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
at 2306085 SLING-11916 - MockEventAdminTest.testPostEvents times out on Jenkins/Windows
This branch includes the following new commits:
new 2306085 SLING-11916 - MockEventAdminTest.testPostEvents times out on Jenkins/Windows
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[sling-org-apache-sling-testing-osgi-mock] 01/01: SLING-11916 - MockEventAdminTest.testPostEvents times out on Jenkins/Windows
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch issue/SLING-11916
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
commit 2306085ea0a731a7f1a6865b95d32ddca2c5a0c4
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Jun 27 14:18:49 2023 +0200
SLING-11916 - MockEventAdminTest.testPostEvents times out on Jenkins/Windows
Make DummyEventHandler thread-safe. The EventHandler is potentially invoked from multiple threads,
and improper synchronisation can lead to missing events.
---
.../java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
index 4328f2f..4c71284 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
@@ -20,10 +20,10 @@ package org.apache.sling.testing.mock.osgi;
import static org.junit.Assert.assertEquals;
-import java.util.ArrayList;
import java.util.Dictionary;
import java.util.List;
import java.util.Objects;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.sling.testing.mock.osgi.junit.OsgiContext;
import org.junit.Before;
@@ -119,7 +119,7 @@ public class MockEventAdminTest {
private static class DummyEventHandler implements EventHandler {
- private final List<Event> receivedEvents = new ArrayList<Event>();
+ private final List<Event> receivedEvents = new CopyOnWriteArrayList<>();
@Override
public void handleEvent(Event event) {