summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-03-01 10:11:58 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2016-03-01 10:11:58 +0100
commit6c2a2f1d6b1b9ff2bdd27524015e51a8d8aaafc9 (patch)
treefc187839ce568ab2831ed3acfa41007aad75834b
parentd5b9e35e2f0c7196f6f458ff4d0fb267f45301c5 (diff)
downloadudisks-6c2a2f1d6b1b9ff2bdd27524015e51a8d8aaafc9.tar.gz
integration-test: Add timeout to readd_device()
-rwxr-xr-xsrc/tests/integration-test5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tests/integration-test b/src/tests/integration-test
index 3c09880..6320e6a 100755
--- a/src/tests/integration-test
+++ b/src/tests/integration-test
@@ -469,8 +469,11 @@ class UDisksTestCase(unittest.TestCase):
assert len(scan_files) > 0
for f in scan_files:
open(f, 'w').write('- - -\n')
- while not os.path.exists(klass.device):
+ timeout = 100
+ while not os.path.exists(klass.device) and timeout > 0:
time.sleep(0.1)
+ timeout -= 1
+ assert os.path.exists(klass.device), 'timed out waiting for %s to exist' % klass.device
time.sleep(0.5)
klass.sync()