Skip to content

Commit

Permalink
reproduce test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
hmottestad committed Dec 29, 2024
1 parent fbf6bea commit 8355988
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;

import org.eclipse.rdf4j.common.concurrent.locks.Properties;
import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.eclipse.rdf4j.common.transaction.IsolationLevels;
import org.eclipse.rdf4j.model.IRI;
Expand All @@ -36,7 +37,7 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Timeout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -77,6 +78,7 @@ public abstract class SailConcurrencyTest {

@BeforeEach
public void setUp() {
Properties.setLockTrackingEnabled(true);
store = createSail();
store.init();
vf = store.getValueFactory();
Expand Down Expand Up @@ -157,6 +159,7 @@ public int getSize() {
*/
@Test
@Timeout(value = 30, unit = TimeUnit.MINUTES)
// @RepeatedTest(100)
public void testConcurrentAddLargeTxn() throws Exception {
logger.info("executing two large concurrent transactions");
final CountDownLatch runnersDone = new CountDownLatch(2);
Expand Down Expand Up @@ -199,6 +202,7 @@ public void testConcurrentAddLargeTxn() throws Exception {
*/
@Test
@Timeout(value = 30, unit = TimeUnit.MINUTES)
// @RepeatedTest(100)
public void testConcurrentAddLargeTxnRollback() throws Exception {
logger.info("executing two large concurrent transactions");
final CountDownLatch runnersDone = new CountDownLatch(2);
Expand Down Expand Up @@ -317,6 +321,7 @@ public void testGetContextIDs() throws Exception {
}
}

// @RepeatedTest(100)
@Test
@Timeout(value = 30, unit = TimeUnit.MINUTES)
public void testConcurrentConnectionsShutdown() throws InterruptedException {
Expand Down Expand Up @@ -362,6 +367,7 @@ public void testConcurrentConnectionsShutdown() throws InterruptedException {
}

// @Disabled
// @RepeatedTest(100)
@Test
@Timeout(value = 30, unit = TimeUnit.MINUTES)
public void testSerialThreads() throws InterruptedException {
Expand Down Expand Up @@ -443,6 +449,7 @@ public void testSerialThreads() throws InterruptedException {

}

// @RepeatedTest(100)
@Test
@Timeout(value = 30, unit = TimeUnit.MINUTES)
public void testConcurrentConnectionsShutdownReadCommitted() throws InterruptedException {
Expand Down Expand Up @@ -499,6 +506,7 @@ public void testConcurrentConnectionsShutdownReadCommitted() throws InterruptedE

}

// @RepeatedTest(100)
@Test
@Timeout(value = 30, unit = TimeUnit.MINUTES)
public void testConcurrentConnectionsShutdownAndClose() throws InterruptedException {
Expand Down Expand Up @@ -545,13 +553,24 @@ public void testConcurrentConnectionsShutdownAndClose() throws InterruptedExcept

try {
if (thread2.isAlive()) {
// try {
connection2.get().close();

// }finally {
connection1.get().close();

// }
} else {
// try {
connection1.get().close();

// }finally {
connection2.get().close();

// }
}
} catch (SailException ignored) {
} catch (Throwable logged) {
logger.error("Error closing connection", logged);
}

try (SailConnection connection = store.getConnection()) {
Expand All @@ -575,6 +594,7 @@ public void testConcurrentConnectionsShutdownAndClose() throws InterruptedExcept
store.shutDown();
}

// @RepeatedTest(100)
@Test
@Timeout(value = 30, unit = TimeUnit.MINUTES)
public void testConcurrentConnectionsShutdownAndCloseRollback() throws InterruptedException {
Expand Down

0 comments on commit 8355988

Please sign in to comment.