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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/wptserve.py

Issue 2511013002: webkitpy: Refactor _stop_running_server for wptserve (Closed)
Patch Set: Remove extra return statement. 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: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/wptserve.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/wptserve.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/wptserve.py
index 6040f80b90d0d07ad105cb142032e7149e56c4e2..b4635b98faedb6c18ae90afc11f49dc4e0147121 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/wptserve.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/wptserve.py
@@ -60,17 +60,18 @@ class WPTServe(server_base.ServerBase):
% (expiration_date.strftime('%b %d %Y'), path_to_wpt_support))
def _stop_running_server(self):
- # Clean up the pid file.
- if self._pid and not self._executive.check_running_pid(self._pid):
- self._filesystem.remove(self._pid_file)
- return
+ while self._pid and self._executive.check_running_pid(self._pid):
+ # TODO(burnik): Figure out a cleaner way of stopping wptserve.
+ if self._platform.is_win():
+ self._executive.kill_process(self._pid)
+ else:
+ self._executive.interrupt(self._pid)
- # TODO(burnik): Figure out a cleaner way of stopping wptserve.
- if self._platform.is_win():
- self._executive.kill_process(self._pid)
- else:
- self._executive.interrupt(self._pid)
+ # According to Popen.wait(), this can deadlock when using stdout=PIPE and/or stderr=PIPE.
+ # We're using DEVNULL for both so that should not occur.
+ if self._process is not None:
+ self._process.wait()
- # According to Popen.wait(), this can deadlock when using stdout=PIPE and/or stderr=PIPE.
- # We're using DEVNULL for both so that should not occur.
- self._process.wait()
+ # Clean up the pid file.
+ if self._filesystem.exists(self._pid_file):
+ self._filesystem.remove(self._pid_file)
« 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