Its difficult to know 100%, but this random test failures appeared to be caused by two issues. One was that get_ordered_network is being checked for None, when it was returning a zero length array. Because of this the scanning block was never executed in any cases. This was fixed in the previous commit. The other issue was the disconnect at the start of the tests. The disconnect will cause all pending scans to cancel, which appeared to cause the scanning block below to be skipped over quickly if the timing was right. Then, afterwards, getting a single network failed because scanning was not complete. --- autotests/testEAP-MSCHAPV2/connection_test.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/autotests/testEAP-MSCHAPV2/connection_test.py b/autotests/testEAP-MSCHAPV2/connection_test.py index d38f4b09..35926375 100644 --- a/autotests/testEAP-MSCHAPV2/connection_test.py +++ b/autotests/testEAP-MSCHAPV2/connection_test.py @@ -19,11 +19,6 @@ class Test(unittest.TestCase): devices = wd.list_devices(1) device = devices[0] - try: - device.disconnect() - except: - pass - condition = 'not obj.scanning' wd.wait_for_object_condition(device, condition) -- 2.17.1