Skip to content

Commit a49c608

Browse files
committed
Add comments about the Thread usage.
1 parent 559242b commit a49c608

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

firebase-firestore/src/test/java/com/google/firebase/firestore/local/SQLiteLocalStoreTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ public void testDeeplyNestedServerTimestamps() {
334334
add(fieldTransform);
335335
}
336336
};
337+
// The purpose of this test is to ensure that deeply nested server timestamps do not result in
338+
// a stack overflow error. Below we use a `Thread` object to create a large number of mutations
339+
// because the `Thread` class allows us to specify the maximum stack size.
337340
AtomicReference<Throwable> error = new AtomicReference<>();
338341
Thread thread =
339342
new Thread(
@@ -353,8 +356,8 @@ public void testDeeplyNestedServerTimestamps() {
353356
error.set(e);
354357
}
355358
},
356-
"test",
357-
1024 * 1024);
359+
/* name */ "test",
360+
/* stackSize */ 1024 * 1024);
358361
try {
359362
thread.start();
360363
thread.join();

0 commit comments

Comments
 (0)