Similar to #6605. See: https://source.cloud.google.com/results/invocations/57661644-6fd2-4203-a515-4c3bf9edfcd5/targets/cloud-devrel%2Fclient-libraries%2Fgoogle-cloud-python%2Fpresubmit%2Ffirestore/log
_______________________________test_watch_query_______________________________client=<google.cloud.firestore_v1beta1.client.Clientobjectat0x7f61dc7705f8>cleanup=<built-inmethodappendoflistobjectat0x7f61d83f3688>deftest_watch_query(client, cleanup):
db=clientdoc_ref=db.collection(u"users").document(u"alovelace"+unique_resource_id())
query_ref=db.collection(u"users").where("first", "==", u"Ada")
# Initial settingdoc_ref.set({u"first": u"Jane", u"last": u"Doe", u"born": 1900})
sleep(1)
# Setup listenerdefon_snapshot(docs, changes, read_time):
on_snapshot.called_count+=1# A snapshot should return the same thing as if a query ran now.query_ran=db.collection(u"users").where("first", "==", u"Ada").get()
assertlen(docs) ==len([iforiinquery_ran])
on_snapshot.called_count=0query_ref.on_snapshot(on_snapshot)
# Alter documentdoc_ref.set({u"first": u"Ada", u"last": u"Lovelace", u"born": 1815})
for_inrange(10):
ifon_snapshot.called_count==1:
returnsleep(1)
ifon_snapshot.called_count!=1:
raiseAssertionError(
"Failed to get exactly one document change: count: ">+str(on_snapshot.called_count)
)
EAssertionError: Failedtogetexactlyonedocumentchange: count: 0tests/system.py:795: AssertionError
Similar to #6605. See: https://source.cloud.google.com/results/invocations/57661644-6fd2-4203-a515-4c3bf9edfcd5/targets/cloud-devrel%2Fclient-libraries%2Fgoogle-cloud-python%2Fpresubmit%2Ffirestore/log