Skip to content

Commit 2de6163

Browse files
Fix Unit Test
1 parent 26c7aa1 commit 2de6163

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -249,22 +249,25 @@ public void testHandlesSetMutationThenAckThenRelease() {
249249
allocateQuery(query);
250250

251251
writeMutation(setMutation("foo/bar", map("foo", "bar")));
252+
notifyLocalViewChanges(viewChanges(2, asList("foo/bar"), emptyList()));
253+
252254
assertChanged(doc("foo/bar", 0, map("foo", "bar"), Document.DocumentState.LOCAL_MUTATIONS));
253255
assertContains(doc("foo/bar", 0, map("foo", "bar"), Document.DocumentState.LOCAL_MUTATIONS));
254256

255257
acknowledgeMutation(1);
256-
notifyLocalViewChanges(viewChanges(2, asList("foo/bar"), emptyList()));
257258

258259
assertChanged(doc("foo/bar", 1, map("foo", "bar"), Document.DocumentState.COMMITTED_MUTATIONS));
259-
assertContains(doc("foo/bar", 1, map("foo", "bar"), Document.DocumentState.COMMITTED_MUTATIONS));
260+
assertContains(
261+
doc("foo/bar", 1, map("foo", "bar"), Document.DocumentState.COMMITTED_MUTATIONS));
260262

261263
releaseQuery(query);
262264

263265
// It has been acknowledged, and should no longer be retained as there is no target and mutation
264266
if (garbageCollectorIsEager()) {
265267
assertNotContains("foo/bar");
266268
} else {
267-
assertContains(doc("foo/bar", 0, map("foo", "bar"), Document.DocumentState.COMMITTED_MUTATIONS));
269+
assertContains(
270+
doc("foo/bar", 1, map("foo", "bar"), Document.DocumentState.COMMITTED_MUTATIONS));
268271
}
269272
}
270273

firebase-firestore/src/test/resources/json/write_spec_test.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5115,7 +5115,7 @@
51155115
"describeName": "Writes:",
51165116
"itName": "Held writes are released when there are no queries left.",
51175117
"tags": [
5118-
"eager-gc", "exclusive"
5118+
"eager-gc"
51195119
],
51205120
"comment": "This test expects a new target id for a new listen, but without eager gc, the same target id is reused",
51215121
"config": {

0 commit comments

Comments
 (0)