Skip to content

Commit fe38e79

Browse files
committed
resolve comments
1 parent 1a9aecf commit fe38e79

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/TransactionTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -709,23 +709,23 @@ public void testDoesNotRetryOnPermanentError() {
709709
public void testRetryOnAlreadyExistsError() {
710710
final FirebaseFirestore firestore = testFirestore();
711711
DocumentReference doc = firestore.collection("foo").document();
712-
AtomicInteger retryCount = new AtomicInteger(0);
712+
AtomicInteger transactionCallbackCount = new AtomicInteger(0);
713713
waitFor(
714714
firestore.runTransaction(
715715
transaction -> {
716-
retryCount.getAndIncrement();
716+
int currentCount = transactionCallbackCount.incrementAndGet();
717717
transaction.get(doc);
718718
// Do a write outside of the transaction.
719-
if (retryCount.get() == 1) waitFor(doc.set(map("count", retryCount.get())));
719+
if (currentCount == 1) waitFor(doc.set(map("foo1", "bar1")));
720720
// Now try to set the doc within the transaction. This should fail once
721721
// with ALREADY_EXISTS error.
722-
transaction.set(doc, map("count", 22));
722+
transaction.set(doc, map("foo2", "bar2"));
723723
return null;
724724
}));
725725
DocumentSnapshot snapshot = waitFor(doc.get());
726-
assertEquals(2, retryCount.get());
726+
assertEquals(2, transactionCallbackCount.get());
727727
assertTrue(snapshot.exists());
728-
assertEquals(22L, snapshot.getData().get("count"));
728+
assertEquals(map("foo1", "bar1", "foo2", "bar2"), snapshot.getData());
729729
}
730730

731731
@Test

0 commit comments

Comments
 (0)