| 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)
|
|
|