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

Unified Diff: build/android/pylib/chrome_test_server_spawner.py

Issue 2508873003: Kill any lingering spawning test server on Android when handling /start (Closed)
Patch Set: Fix Created 4 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: build/android/pylib/chrome_test_server_spawner.py
diff --git a/build/android/pylib/chrome_test_server_spawner.py b/build/android/pylib/chrome_test_server_spawner.py
index e1eb6b384f6e6a1e0bc2403273b1358a03e5acb7..bd729c892b1892c02a7a3361cadc96777616a35f 100644
--- a/build/android/pylib/chrome_test_server_spawner.py
+++ b/build/android/pylib/chrome_test_server_spawner.py
@@ -321,7 +321,14 @@ class SpawningServerRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
logging.info(content_length)
test_server_argument_json = self.rfile.read(content_length)
logging.info(test_server_argument_json)
- assert not self.server.test_server_instance
+ # There should only be one test server instance at a time. However it may
+ # be possible that a previous instance was not cleaned up properly
+ # (crbug.com/665686)
+ if self.server.test_server_instance:
+ port = self.server.test_server_instance.host_port
+ logging.info('Killing lingering test server instance on port: %d', port)
+ self.server.test_server_instance.Stop()
+ self.server.test_server_instance = None
ready_event = threading.Event()
self.server.test_server_instance = TestServerThread(
ready_event,
« 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