test weaks
This commit is contained in:
@@ -35,8 +35,7 @@ def test_consistent_history(client, live_server, measure_memory_usage):
|
||||
)
|
||||
assert b"Settings updated." in res.data
|
||||
|
||||
|
||||
time.sleep(2)
|
||||
wait_for_all_checks(client)
|
||||
|
||||
json_db_file = os.path.join(live_server.app.config['DATASTORE'].datastore_path, 'url-watches.json')
|
||||
|
||||
@@ -48,9 +47,11 @@ def test_consistent_history(client, live_server, measure_memory_usage):
|
||||
assert len(json_obj['watching']) == len(r), "Correct number of watches was found in the JSON"
|
||||
|
||||
# each one should have a history.txt containing just one line
|
||||
i=0
|
||||
for w in json_obj['watching'].keys():
|
||||
i+1
|
||||
history_txt_index_file = os.path.join(live_server.app.config['DATASTORE'].datastore_path, w, 'history.txt')
|
||||
assert os.path.isfile(history_txt_index_file), f"History.txt should exist where I expect it at {history_txt_index_file}"
|
||||
assert os.path.isfile(history_txt_index_file), f"history.txt for i: {i} should exist where I expect it at {history_txt_index_file}"
|
||||
|
||||
# Same like in model.Watch
|
||||
with open(history_txt_index_file, "r") as f:
|
||||
|
||||
@@ -139,9 +139,10 @@ def wait_for_all_checks(client=None):
|
||||
# Get queue size safely - update_q is a SignalPriorityQueue
|
||||
q_length = global_update_q.qsize()
|
||||
if not q_length:
|
||||
logging.getLogger().info(f"queue empty at attempt {attempt}")
|
||||
break
|
||||
logging.getLogger().info(f"Waiting for empty queue.... {attempt}")
|
||||
time.sleep(0.8)
|
||||
time.sleep(2)
|
||||
attempt += 1
|
||||
|
||||
time.sleep(1.2)
|
||||
|
||||
Reference in New Issue
Block a user