Skip to content

Commit 8278251

Browse files
Tests: note why to rely on tests or the library to clean up resources
1 parent 992af54 commit 8278251

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/objectbox-java-test/src/test/java/io/objectbox/AbstractObjectBoxTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ protected Box<TestEntity> getTestEntityBox() {
162162

163163
@After
164164
public void tearDown() {
165+
// Note: do not collect dangling Cursors and Transactions before store closes (using System.gc()
166+
// or System.runFinalization()). Tests should mirror user code and do that themselves (calling close())
167+
// or rely on the library (through finalizers or BoxStore.close()).
168+
165169
if (store != null) {
166170
try {
167171
store.close();

0 commit comments

Comments
 (0)