ble.py - remove history sanity check
This commit is contained in:
1 parent
74d68fdcbb
commit
08ff334100
1 file changed
+20
-20
+20
-20
@@ -291,28 +291,28 @@ def test(test_count = 0, bt_usb_id = None) -> None:
|
|||||||
test_list = mac_list
|
test_list = mac_list
|
||||||
passed_list = []
|
passed_list = []
|
||||||
# History buffer - keep the last N snapshots (N=5)
|
# History buffer - keep the last N snapshots (N=5)
|
||||||
print("Creating history variable")
|
#print("Creating history variable")
|
||||||
history = []
|
#history = []
|
||||||
print("Done")
|
#print("Done")
|
||||||
prev_list_snapshot = None
|
#prev_list_snapshot = None
|
||||||
print("Just before the loop")
|
#print("Just before the loop")
|
||||||
while not test_result:
|
while not test_result:
|
||||||
# Check if the failed list has been the same for 5 loops
|
# Check if the failed list has been the same for 5 loops
|
||||||
print("Check if the failed list has been the same for 5 loops")
|
#print("Check if the failed list has been the same for 5 loops")
|
||||||
if prev_list_snapshot is not None and passed_list == prev_list_snapshot:
|
# if prev_list_snapshot is not None and passed_list == prev_list_snapshot:
|
||||||
# List unchanged - add to history
|
# # List unchanged - add to history
|
||||||
print("List unchanged - add to history")
|
# print("List unchanged - add to history")
|
||||||
history.append(passed_list)
|
# history.append(passed_list)
|
||||||
else:
|
# else:
|
||||||
# List changed - reset history
|
# # List changed - reset history
|
||||||
print("List changed - reset history")
|
# print("List changed - reset history")
|
||||||
history = []
|
# history = []
|
||||||
history.append(current_list)
|
# history.append(current_list)
|
||||||
if len(history) == 5 and all(lst == history[0] for lst in history):
|
# if len(history) == 5 and all(lst == history[0] for lst in history):
|
||||||
log.warning(f"Last 5 tests have been identical, resetting adapter")
|
# log.warning(f"Last 5 tests have been identical, resetting adapter")
|
||||||
reset_adapter()
|
# reset_adapter()
|
||||||
history = []
|
# history = []
|
||||||
prev_list_snapshot = current_list
|
# prev_list_snapshot = current_list
|
||||||
|
|
||||||
log.info(f" Test run: {test_count} - loop {test_loop_count} start. Initializing run...")
|
log.info(f" Test run: {test_count} - loop {test_loop_count} start. Initializing run...")
|
||||||
test_run_results = sensor_data_query(test_list)
|
test_run_results = sensor_data_query(test_list)
|
||||||
|
|||||||
Reference in new issue
Block a user