Skip to content

Commit c8f58e6

Browse files
committed
Ignore testTxGC: Tests robustness in invalid usage scenarios with lots of errors raised and resources leaked. Only run this test manually from time to time, but spare regular test runs from those errors.
1 parent e7045ed commit c8f58e6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/objectbox-java-test/src/main/java/io/objectbox/TransactionTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package io.objectbox;
1818

19+
import org.junit.Ignore;
1920
import org.junit.Test;
2021

2122
import java.util.concurrent.Callable;
@@ -197,11 +198,16 @@ public void testTransactionUsingAfterStoreClosed() {
197198
}*/
198199

199200
@Test
201+
@Ignore("Tests robustness in invalid usage scenarios with lots of errors raised and resources leaked." +
202+
"Only run this test manually from time to time, but spare regular test runs from those errors.")
200203
public void testTxGC() throws InterruptedException {
201204
// Trigger pending finalizers so we have less finalizers to run later
202205
System.gc();
203206
System.runFinalization();
204207

208+
// Dangling TXs is exactly what we are testing here
209+
Transaction.TRACK_CREATION_STACK = false;
210+
205211
// For a real test, use count = 100000 and check console output that TX get freed in between
206212
int count = runExtensiveTests ? 100000 : 1000;
207213
Thread[] threads = new Thread[count];
@@ -212,7 +218,7 @@ public void testTxGC() throws InterruptedException {
212218
@Override
213219
public void run() {
214220
try {
215-
Transaction tx = store.beginReadTx();
221+
store.beginReadTx();
216222
} catch (DbMaxReadersExceededException e) {
217223
readersFull.incrementAndGet();
218224
}

0 commit comments

Comments
 (0)