Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: dart/tools/testing/run_selenium.py

Issue 11275125: Prevent hanging if selenium cannot close browser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/testing/run_selenium.py
diff --git a/dart/tools/testing/run_selenium.py b/dart/tools/testing/run_selenium.py
index 322f560617d00a66b8a171881c08e2ed8acb32ba..001c088a3b9293101defa824369f16a2c5bc6074 100755
--- a/dart/tools/testing/run_selenium.py
+++ b/dart/tools/testing/run_selenium.py
@@ -40,6 +40,7 @@ import socket
import sys
import time
import urllib2
+import threading
TIMEOUT_ERROR_MSG = 'FAIL (timeout)'
@@ -315,9 +316,27 @@ def run_batch_tests():
print '>>> TEST FAIL'
sys.stdout.flush()
finally:
+ sys.stdin.close()
print("Closing browser");
- close_browser(browser)
+ def close_output_streams:
+ sys.stdout.flush()
+ sys.stdout.close()
+ sys.stderr.flush()
+ sys.stderr.close()
+
+ def close_and_exit:
+ print("Timed out waiting for browser to close")
+ close_output_streams()
+ exit(1)
+
+ timer = threading.Timer(5.0, close_and_exit)
+ timer.start()
+ try:
+ close_browser(browser)
+ timer.cancel()
+ finally:
+ close_output_streams()
def main(args):
# Run in batch mode if the --batch flag is passed.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698