conman: Deflake test.
The test contained a race condition which could result in a scan
happening before expected, and then an infinite loop waiting for a
scan that never happened. The fix is easy (and obvious in
retrospect): don't enable the scan results until immediately before
the run_until_interface_update_and_scan call.
Change-Id: I8fbc8e7377cebfa8f4b471ec9806da50e2cd2e37
diff --git a/conman/connection_manager_test.py b/conman/connection_manager_test.py
index 76ee910..3dcadcd 100755
--- a/conman/connection_manager_test.py
+++ b/conman/connection_manager_test.py
@@ -641,10 +641,10 @@
# the scan results, and scan again. This time, the first SSID tried should be
# 's3', which is not present in the scan results but *is* advertised by the
# secure AP running the user's WLAN.
- c.can_connect_to_s2 = False
- c.scan_results_include_hidden = True
c.delete_wlan_config('2.4')
c.run_once()
+ c.can_connect_to_s2 = False
+ c.scan_results_include_hidden = True
wvtest.WVFAIL(c.has_status_files([status.P.CONNECTED_TO_WLAN]))
c.run_until_interface_update_and_scan('2.4')
c.run_until_interface_update()