diff mbox series

auto-t: fix timing issue in testEncryptedProfiles

Message ID 20220615225012.932391-1-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series auto-t: fix timing issue in testEncryptedProfiles | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-alpine-ci-build success Build - Configure
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-alpine-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-alpine-ci-makecheck success Make Check
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

James Prestwood June 15, 2022, 10:50 p.m. UTC
test_decryption_failure is quite simple and only verifies that a known
network exists after starting. This causes the test to end before IWD can
fully start up leaving the DBus utilities in limbo having not fully
initialized.

Then, on the next test, stale InterfaceAdded signals arrive (for Station
and P2P) which throw exceptions when trying to get the bus (since IWD is
long gone). In addition the next IWD instance has started so any paths
included in the InterfaceAdded signals are bogus and cause additional
exceptions.

At the end of this test we can call list_devices() which will wait for
the InterfaceAdded signal, and cleanly exit afterwards.
---
 autotests/testEncryptedProfiles/connection_test.py | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/autotests/testEncryptedProfiles/connection_test.py b/autotests/testEncryptedProfiles/connection_test.py
index dd4892ca..2b846596 100644
--- a/autotests/testEncryptedProfiles/connection_test.py
+++ b/autotests/testEncryptedProfiles/connection_test.py
@@ -115,6 +115,12 @@  EncryptedSecurity=aabbccddeeff00112233445566778899
 
         self.assertEqual(wd.list_known_networks(), [])
 
+        # This test starts and stops IWD so quickly the DBus utilities don't
+        # even have a chance to set up the Device interface object which causes
+        # exceptions on the next test as the InterfaceAdded signals arrive. This
+        # allows the device interface to get set up before ending the test.
+        wd.list_devices(1)
+
     def test_runtime_profile(self):
         wd = IWD(True)