@@ -709,23 +709,23 @@ public void testDoesNotRetryOnPermanentError() {
709
709
public void testRetryOnAlreadyExistsError () {
710
710
final FirebaseFirestore firestore = testFirestore ();
711
711
DocumentReference doc = firestore .collection ("foo" ).document ();
712
- AtomicInteger retryCount = new AtomicInteger (0 );
712
+ AtomicInteger transactionCallbackCount = new AtomicInteger (0 );
713
713
waitFor (
714
714
firestore .runTransaction (
715
715
transaction -> {
716
- retryCount . getAndIncrement ();
716
+ int currentCount = transactionCallbackCount . incrementAndGet ();
717
717
transaction .get (doc );
718
718
// 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" )));
720
720
// Now try to set the doc within the transaction. This should fail once
721
721
// with ALREADY_EXISTS error.
722
- transaction .set (doc , map ("count " , 22 ));
722
+ transaction .set (doc , map ("foo2 " , "bar2" ));
723
723
return null ;
724
724
}));
725
725
DocumentSnapshot snapshot = waitFor (doc .get ());
726
- assertEquals (2 , retryCount .get ());
726
+ assertEquals (2 , transactionCallbackCount .get ());
727
727
assertTrue (snapshot .exists ());
728
- assertEquals (22L , snapshot .getData (). get ( "count" ));
728
+ assertEquals (map ( "foo1" , "bar1" , "foo2" , "bar2" ), snapshot .getData ());
729
729
}
730
730
731
731
@ Test
0 commit comments