summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-07-20 10:19:51 -0700
committerEric Anholt <eric@anholt.net>2012-07-26 16:29:09 -0700
commit518d217b045e847d19ac6d9223b3cd489648d8fc (patch)
tree8e669d74c5f4a43146675f1a24efdef2dbc72464
parentdcb1d026f3769c1dda85198bd554954877b7e233 (diff)
framework: When a test catches a spurious window resize, re-run it.
Otherwise, we'd see massive spam of WARN tests, due to the frequency of the bug (about 2% of testcases on my system). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--framework/exectest.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/framework/exectest.py b/framework/exectest.py
index 2052a4c24..d2173d483 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -54,14 +54,26 @@ class ExecTest(Test):
if valgrind:
command[:0] = ['valgrind', '--quiet', '--error-exitcode=1', '--tool=memcheck']
- proc = subprocess.Popen(
- command,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- env=fullenv,
- universal_newlines=True
- )
- out, err = proc.communicate()
+ i = 0
+ while True:
+ proc = subprocess.Popen(
+ command,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ env=fullenv,
+ universal_newlines=True
+ )
+ out, err = proc.communicate()
+
+ # https://bugzilla.gnome.org/show_bug.cgi?id=680214 is
+ # affecting many developers. If we catch it
+ # happening, try just re-running the test.
+ if out.find("Got spurious window resize") >= 0:
+ i = i + 1
+ if i >= 5:
+ break
+ else:
+ break
# proc.communicate() returns 8-bit strings, but we need
# unicode strings. In Python 2.x, this is because we