mduerig commented on code in PR #128: URL: https://github.com/apache/jackrabbit/pull/128#discussion_r978547476
########## jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImplTest.java: ########## @@ -0,0 +1,39 @@ +package org.apache.jackrabbit.jcr2spi.hierarchy; + +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.ConcurrentModificationException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.junit.Test; + +public class ChildNodeEntriesImplTest { + + private final ExecutorService executorService = Executors.newFixedThreadPool(10); + + @Test(expected = ConcurrentModificationException.class) + public void concurrentModification() throws Throwable { + ChildNodeEntriesImpl entries = new ChildNodeEntriesImpl(null, null, null); + Collection<Future<?>> futures = new ArrayList<>(); Review Comment: @rkovarik the test failing looks like a timing issue. If you pre-populate the child nodes entries it has a greater chance to actually run into a ConcurrentModificationException. I.e. adding 100 child nodes did the trick for me. for (int k = 0; k < 100; k++) { entries.add(mock(NodeEntry.class)); } -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org