Add prints to follow the flow in CI

This commit is contained in:
Nico Andrade
2020-10-05 13:09:29 -04:00
parent 101fbbf046
commit 3c339cb927
2 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -144,8 +144,9 @@ class _MongoCore(_BaseCore):
if not entry['being_calculated']:
return entry['value']
print("Got an entry. It is being calculated. Do we wait?", time_spent, self.wait_for_calc_timeout, time_spent >= self.wait_for_calc_timeout)
if self.wait_for_calc_timeout > 0 and time_spent >= self.wait_for_calc_timeout:
print("Got an entry. Is not valid. Force recomputation.", time_spent, self.wait_for_calc_timeout, time_spent >= self.wait_for_calc_timeout)
print("Tired of waiting. RecalculationNeeded.", time_spent, self.wait_for_calc_timeout, time_spent >= self.wait_for_calc_timeout)
raise RecalculationNeeded()
+5 -3
View File
@@ -201,15 +201,17 @@ def test_mongo_wait_for_calc_timeout_slow():
thread1.start()
thread2.start()
sleep(1)
res3 = _wait_for_calc_timeout_mongo_slow(1, 2)
sleep(4)
thread1.join()
thread2.join()
thread2.join()
assert res_queue.qsize() == 2
res1 = res_queue.get()
res2 = res_queue.get()
assert res1 != res2 # Timeout kicked in. Two calls were done
res3 = _wait_for_calc_timeout_mongo_slow(1, 2)
assert res2 == res3 or res1 == res3 # One of the cached values is returned
res4 = _wait_for_calc_timeout_mongo_slow(1, 2)
assert res1 == res4 or res2 == res4 or res3 == res4 # One of the cached values is returned
class _BadMongoCollection: