2020import java .util .concurrent .atomic .AtomicInteger ;
2121import java .util .concurrent .atomic .AtomicReference ;
2222
23+ import org .eclipse .rdf4j .common .concurrent .locks .Properties ;
2324import org .eclipse .rdf4j .common .iteration .CloseableIteration ;
2425import org .eclipse .rdf4j .common .transaction .IsolationLevels ;
2526import org .eclipse .rdf4j .model .IRI ;
3637import org .junit .jupiter .api .Assertions ;
3738import org .junit .jupiter .api .BeforeEach ;
3839import org .junit .jupiter .api .Disabled ;
39- import org .junit .jupiter .api .Test ;
40+ import org .junit .jupiter .api .RepeatedTest ;
4041import org .junit .jupiter .api .Timeout ;
4142import org .slf4j .Logger ;
4243import org .slf4j .LoggerFactory ;
@@ -77,6 +78,7 @@ public abstract class SailConcurrencyTest {
7778
7879 @ BeforeEach
7980 public void setUp () {
81+ Properties .setLockTrackingEnabled (true );
8082 store = createSail ();
8183 store .init ();
8284 vf = store .getValueFactory ();
@@ -157,6 +159,7 @@ public int getSize() {
157159 */
158160 @ Test
159161 @ Timeout (value = 30 , unit = TimeUnit .MINUTES )
162+ // @RepeatedTest(100)
160163 public void testConcurrentAddLargeTxn () throws Exception {
161164 logger .info ("executing two large concurrent transactions" );
162165 final CountDownLatch runnersDone = new CountDownLatch (2 );
@@ -199,6 +202,7 @@ public void testConcurrentAddLargeTxn() throws Exception {
199202 */
200203 @ Test
201204 @ Timeout (value = 30 , unit = TimeUnit .MINUTES )
205+ // @RepeatedTest(100)
202206 public void testConcurrentAddLargeTxnRollback () throws Exception {
203207 logger .info ("executing two large concurrent transactions" );
204208 final CountDownLatch runnersDone = new CountDownLatch (2 );
@@ -317,6 +321,7 @@ public void testGetContextIDs() throws Exception {
317321 }
318322 }
319323
324+ // @RepeatedTest(100)
320325 @ Test
321326 @ Timeout (value = 30 , unit = TimeUnit .MINUTES )
322327 public void testConcurrentConnectionsShutdown () throws InterruptedException {
@@ -362,6 +367,7 @@ public void testConcurrentConnectionsShutdown() throws InterruptedException {
362367 }
363368
364369 // @Disabled
370+ // @RepeatedTest(100)
365371 @ Test
366372 @ Timeout (value = 30 , unit = TimeUnit .MINUTES )
367373 public void testSerialThreads () throws InterruptedException {
@@ -443,6 +449,7 @@ public void testSerialThreads() throws InterruptedException {
443449
444450 }
445451
452+ // @RepeatedTest(100)
446453 @ Test
447454 @ Timeout (value = 30 , unit = TimeUnit .MINUTES )
448455 public void testConcurrentConnectionsShutdownReadCommitted () throws InterruptedException {
@@ -499,6 +506,7 @@ public void testConcurrentConnectionsShutdownReadCommitted() throws InterruptedE
499506
500507 }
501508
509+ // @RepeatedTest(100)
502510 @ Test
503511 @ Timeout (value = 30 , unit = TimeUnit .MINUTES )
504512 public void testConcurrentConnectionsShutdownAndClose () throws InterruptedException {
@@ -545,13 +553,24 @@ public void testConcurrentConnectionsShutdownAndClose() throws InterruptedExcept
545553
546554 try {
547555 if (thread2 .isAlive ()) {
556+ // try {
548557 connection2 .get ().close ();
558+
559+ // }finally {
549560 connection1 .get ().close ();
561+
562+ // }
550563 } else {
564+ // try {
551565 connection1 .get ().close ();
566+
567+ // }finally {
552568 connection2 .get ().close ();
569+
570+ // }
553571 }
554- } catch (SailException ignored ) {
572+ } catch (Throwable logged ) {
573+ logger .error ("Error closing connection" , logged );
555574 }
556575
557576 try (SailConnection connection = store .getConnection ()) {
@@ -575,6 +594,7 @@ public void testConcurrentConnectionsShutdownAndClose() throws InterruptedExcept
575594 store .shutDown ();
576595 }
577596
597+ // @RepeatedTest(100)
578598 @ Test
579599 @ Timeout (value = 30 , unit = TimeUnit .MINUTES )
580600 public void testConcurrentConnectionsShutdownAndCloseRollback () throws InterruptedException {
0 commit comments