[Piglit] [PATCH 2/2] framework: When a test catches a spurious window resize, re-run it.

Eric Anholt eric at anholt.net
Fri Jul 20 11:00:00 PDT 2012


Otherwise, we'd see massive spam of WARN tests, due to the frequency
of the bug (about 2% of testcases on my system).
---
 framework/exectest.py |   28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/framework/exectest.py b/framework/exectest.py
index 2052a4c..d2173d4 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
-- 
1.7.10.4



More information about the Piglit mailing list