Bug 63956 - new-run-webkit-tests fails to start http server if one is already running
Summary: new-run-webkit-tests fails to start http server if one is already running
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on:
Blocks: 34984
  Show dependency treegraph
 
Reported: 2011-07-05 15:11 PDT by Eric Seidel (no email)
Modified: 2011-07-05 16:00 PDT (History)
2 users (show)

See Also:


Attachments
Patch (7.82 KB, patch)
2011-07-05 15:42 PDT, Eric Seidel (no email)
abarth: review+
abarth: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2011-07-05 15:11:33 PDT
new-run-webkit-tests fails to start http server if one is already running

It turns out old-run-webkit-tests seems to be really bad about shutting down httpd if it's interrupted/killed (as can commonly happen on the buildbots if someone cancels a build).

We already seem to have a Tools/BuildSlaveSupport/kill-old-processes script to help with this.  However that script doesn't know how to kill httpd on Mac.

Trying to switch the bots to NRWT we're commonly encountering an error where NRWT refuses to start because there is already something bound to the 8080 port (so far it's always been an httpd server from a previous ORWT run).

So I propose we add "httpd" to kill-old-processes and then buildbot will automatically clean these up before calling run-webkit-tests.
Comment 1 Adam Roben (:aroben) 2011-07-05 15:18:12 PDT
Why not make NRWT automatically kill old httpd processes, like old-run-webkit-tests does? That would help regular folks, too, not just the bots.
Comment 2 Eric Seidel (no email) 2011-07-05 15:34:56 PDT
ORWT only will kill old httpds if they're using the webkit pid file:
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitperl/httpd.pm#L168

NRWT does the same:
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py#L75

Looks like the assumed pid file names are different though:
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitperl/httpd.pm#L68
Looks like it produces /tmp/WebKit/httpd.pid


http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py#L62
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py#L51
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py#L59

Looks like it produces:
/tmp/WebKit/apache.pid (at least on Mac)

I could easily change NRWT to look at httpd.pid instead, maybe that's the better fix?

Why does windows kill-old-processes kill httpd?
Comment 3 Eric Seidel (no email) 2011-07-05 15:42:31 PDT
Created attachment 99756 [details]
Patch
Comment 4 Eric Seidel (no email) 2011-07-05 15:48:40 PDT
Thanks for your prod, aroben.  After my investigation realizing that the pid file paths were different, this fix is much cleaner.  Because I had already cleaned up kill-old-processes, I added that to the patch (even though there are no functional changes, just removing the ^M line endings.
Comment 5 Eric Seidel (no email) 2011-07-05 16:00:02 PDT
Committed r90412: <http://trac.webkit.org/changeset/90412>