Skip to content

Commit c47fe2b

Browse files
committed
improve javadocs and make some tests more robust
1 parent 8fbb4ee commit c47fe2b

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/datastore/DataFile.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ public byte[] getData(long offset) throws IOException {
203203
(data[2] << 8) & 0x0000ff00 |
204204
(data[3]) & 0x000000ff;
205205

206-
// If the data length is larger than 750MB, we are likely reading the wrong data. Probably data corruption.
206+
// If the data length is larger than 750MB, we are likely reading the wrong data. Probably data corruption. The
207+
// limit of 750MB was chosen based on results from experimenting in the NativeSailStoreCorruptionTest class.
207208
if (dataLength > 128 * 1024 * 1024) {
208209
if (SOFT_FAIL_ON_CORRUPT_DATA_AND_REPAIR_INDEXES) {
209210
logger.error(

core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/MultithreadedTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.junit.jupiter.api.AfterAll;
4747
import org.junit.jupiter.api.BeforeAll;
4848
import org.junit.jupiter.api.Test;
49+
import org.junit.jupiter.api.Timeout;
4950
import org.junit.jupiter.api.parallel.Isolated;
5051
import org.slf4j.LoggerFactory;
5152

@@ -67,6 +68,7 @@ public static void afterAll() {
6768
}
6869

6970
@Test
71+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
7072
public void testDataAndShapes() {
7173
System.out.println("testDataAndShapes");
7274

@@ -339,6 +341,7 @@ private void remove(String turtle, IRI graph) {
339341
}
340342

341343
@Test
344+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
342345
public void testLotsOfValidationFailuresSnapshot() throws IOException {
343346
System.out.println("testLotsOfValidationFailuresSnapshot");
344347
ShaclSail sail = new ShaclSail(getBaseSail());
@@ -354,6 +357,7 @@ public void testLotsOfValidationFailuresSnapshot() throws IOException {
354357
}
355358

356359
@Test
360+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
357361
public void testLotsOfValidationFailuresSerializableValidation() throws IOException {
358362
System.out.println("testLotsOfValidationFailuresSerializableValidation");
359363
Logger root = (Logger) LoggerFactory.getLogger(ShaclSailBaseConfiguration.class.getName());
@@ -371,6 +375,7 @@ public void testLotsOfValidationFailuresSerializableValidation() throws IOExcept
371375
}
372376

373377
@Test
378+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
374379
public void testLotsOfValidationFailuresSerializable() throws IOException {
375380
System.out.println("testLotsOfValidationFailuresSerializable");
376381

@@ -389,6 +394,7 @@ public void testLotsOfValidationFailuresSerializable() throws IOException {
389394
}
390395

391396
@Test
397+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
392398
public void testLotsOfValidationFailuresReadCommitted() throws IOException {
393399
System.out.println("testLotsOfValidationFailuresReadCommitted");
394400
ShaclSail sail = new ShaclSail(getBaseSail());
@@ -403,6 +409,7 @@ public void testLotsOfValidationFailuresReadCommitted() throws IOException {
403409
}
404410

405411
@Test
412+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
406413
public void testLotsOfValidationFailuresReadUncommitted() throws IOException {
407414
System.out.println("testLotsOfValidationFailuresReadUncommitted");
408415
ShaclSail sail = new ShaclSail(getBaseSail());

testsuites/sail/src/main/java/org/eclipse/rdf4j/testsuite/sail/SailConcurrencyTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.junit.jupiter.api.BeforeEach;
3838
import org.junit.jupiter.api.Disabled;
3939
import org.junit.jupiter.api.Test;
40+
import org.junit.jupiter.api.Timeout;
4041
import org.slf4j.Logger;
4142
import org.slf4j.LoggerFactory;
4243

@@ -155,6 +156,7 @@ public int getSize() {
155156
* @see <a href="https://github.com/eclipse/rdf4j/issues/693">https://github.com/eclipse/rdf4j/issues/693</a>
156157
*/
157158
@Test
159+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
158160
public void testConcurrentAddLargeTxn() throws Exception {
159161
logger.info("executing two large concurrent transactions");
160162
final CountDownLatch runnersDone = new CountDownLatch(2);
@@ -196,6 +198,7 @@ public void testConcurrentAddLargeTxn() throws Exception {
196198
* one of the transactions rolls back at the end.
197199
*/
198200
@Test
201+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
199202
public void testConcurrentAddLargeTxnRollback() throws Exception {
200203
logger.info("executing two large concurrent transactions");
201204
final CountDownLatch runnersDone = new CountDownLatch(2);
@@ -237,6 +240,7 @@ public void testConcurrentAddLargeTxnRollback() throws Exception {
237240
}
238241

239242
@Test
243+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
240244
@Disabled("This test takes a long time and accomplishes little extra")
241245
public void testGetContextIDs() throws Exception {
242246
// Create one thread which writes statements to the repository, on a
@@ -314,6 +318,7 @@ public void testGetContextIDs() throws Exception {
314318
}
315319

316320
@Test
321+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
317322
public void testConcurrentConnectionsShutdown() throws InterruptedException {
318323
if (store instanceof AbstractSail) {
319324
((AbstractSail) store).setConnectionTimeOut(200);
@@ -356,8 +361,9 @@ public void testConcurrentConnectionsShutdown() throws InterruptedException {
356361

357362
}
358363

359-
// @Disabled
364+
// @Disabled
360365
@Test
366+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
361367
public void testSerialThreads() throws InterruptedException {
362368
if (store instanceof AbstractSail) {
363369
((AbstractSail) store).setConnectionTimeOut(200);
@@ -438,6 +444,7 @@ public void testSerialThreads() throws InterruptedException {
438444
}
439445

440446
@Test
447+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
441448
public void testConcurrentConnectionsShutdownReadCommitted() throws InterruptedException {
442449
if (store instanceof AbstractSail) {
443450
((AbstractSail) store).setConnectionTimeOut(200);
@@ -493,6 +500,7 @@ public void testConcurrentConnectionsShutdownReadCommitted() throws InterruptedE
493500
}
494501

495502
@Test
503+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
496504
public void testConcurrentConnectionsShutdownAndClose() throws InterruptedException {
497505
if (store instanceof AbstractSail) {
498506
((AbstractSail) store).setConnectionTimeOut(200);
@@ -568,6 +576,7 @@ public void testConcurrentConnectionsShutdownAndClose() throws InterruptedExcept
568576
}
569577

570578
@Test
579+
@Timeout(value = 30, unit = TimeUnit.MINUTES)
571580
public void testConcurrentConnectionsShutdownAndCloseRollback() throws InterruptedException {
572581
if (store instanceof AbstractSail) {
573582
((AbstractSail) store).setConnectionTimeOut(200);

0 commit comments

Comments
 (0)