[gnome-boxes] tests: Wait 50s for shutdown



commit de595b5ed8876840275f1d56c06abd9d8fda9f98
Author: Vladimir Benes <benesv email cz>
Date:   Thu Jun 18 22:54:36 2015 +0200

    tests: Wait 50s for shutdown
    
    Shutdown of Boxes takes some time in case there are more machines
    running so we need to wait up to 50 seconds for it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751042

 tests/steps/general.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/tests/steps/general.py b/tests/steps/general.py
index 73c5b06..783222f 100644
--- a/tests/steps/general.py
+++ b/tests/steps/general.py
@@ -123,7 +123,13 @@ def press_back_in_prefs(context, action):
 @step('Quit Boxes')
 def quit_boxes(context):
     keyCombo('<Ctrl><Q>')
-    sleep(5)
+    counter = 0
+    while call('pidof gnome-boxes > /dev/null', shell=True) != 1:
+        sleep(0.5)
+        counter += 1
+        if counter == 100:
+            raise Exception("Failed to turn off Boxes in 50 seconds")
+
 
 @step('Rename "{machine}" to "{name}" via "{way}"')
 def rename_vm(context, machine, name, way):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]