RESOLVED FIXED 172176
webkitpy: Start servers before setting-up for testing
https://bugs.webkit.org/show_bug.cgi?id=172176
Summary webkitpy: Start servers before setting-up for testing
Jonathan Bedard
Reported 2017-05-16 10:45:55 PDT
On-device testing requires that servers are already running when devices are set-up.
Attachments
Patch (6.89 KB, patch)
2017-05-16 11:03 PDT, Jonathan Bedard
no flags
Patch (9.23 KB, patch)
2017-05-17 15:47 PDT, Jonathan Bedard
no flags
Patch (9.26 KB, patch)
2017-05-19 11:35 PDT, Jonathan Bedard
no flags
Patch (10.75 KB, patch)
2017-05-30 11:20 PDT, Jonathan Bedard
no flags
Patch (12.80 KB, patch)
2017-05-30 11:49 PDT, Jonathan Bedard
no flags
Patch (12.86 KB, patch)
2017-05-30 12:07 PDT, Jonathan Bedard
no flags
Radar WebKit Bug Importer
Comment 1 2017-05-16 10:46:22 PDT
Jonathan Bedard
Comment 2 2017-05-16 11:03:08 PDT
Dean Johnson
Comment 3 2017-05-16 15:23:18 PDT
Comment on attachment 310275 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310275&action=review Unofficial r+. > Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:238 > + needs_websockets = any(self._is_websocket_test(test) for test in tests_to_run) I really like the use of `any` here, as well as the fact you used generators which means we get the best performance possible (other than doing all of this in a single loop). I also prefer this approach due to the readability and conciseness it provides to anyone reading!
Jonathan Bedard
Comment 4 2017-05-16 15:31:06 PDT
Comment on attachment 310275 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310275&action=review >> Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:238 >> + needs_websockets = any(self._is_websocket_test(test) for test in tests_to_run) > > I really like the use of `any` here, as well as the fact you used generators which means we get the best performance possible (other than doing all of this in a single loop). I also prefer this approach due to the readability and conciseness it provides to anyone reading! Glad you like it, but I can't take credit for it. This was moved from def _run_tests, which was committee here: <https://trac.webkit.org/changeset/136730/webkit>
WebKit Commit Bot
Comment 5 2017-05-16 16:19:22 PDT
Comment on attachment 310275 [details] Patch Clearing flags on attachment: 310275 Committed r216955: <http://trac.webkit.org/changeset/216955>
WebKit Commit Bot
Comment 6 2017-05-16 16:19:24 PDT
All reviewed patches have been landed. Closing bug.
Ryan Haddad
Comment 7 2017-05-17 14:50:40 PDT
Reverted r216955 for reason: This change caused strange behavior with web-platform-tests locally and on EWS. Committed r217003: <http://trac.webkit.org/changeset/217003>
Ryan Haddad
Comment 8 2017-05-17 14:54:31 PDT
(In reply to Ryan Haddad from comment #7) > Reverted r216955 for reason: > > This change caused strange behavior with web-platform-tests locally and on > EWS. > > Committed r217003: <http://trac.webkit.org/changeset/217003> In this bug, ios-sim EWS passed, but after the change was landed the tests failed on the trunk ios-sim testers: https://bugs.webkit.org/show_bug.cgi?id=172196 Chris was seeing this locally as well. He made a change that should have caused an existing WPT test to fail and it did fail when it was first run. When the test was retried, it passed.
Jonathan Bedard
Comment 9 2017-05-17 15:09:01 PDT
I think this should be pretty easy to fix. The issue is that we shut down the servers before between our main test run and retrying, which we should not do. There is a larger issue, however, which is unrelated to either this change or Chris's change: we treat missing files as if they have passed.
Jonathan Bedard
Comment 10 2017-05-17 15:47:16 PDT
Jonathan Bedard
Comment 11 2017-05-17 15:50:03 PDT
attachment 310453 [details] should fix the issues Ryan and Chris are talking about. However, I'd like to mark tests as failing if we cannot access testing assets before letting this land, so that these failures do not occur silently.
Jonathan Bedard
Comment 12 2017-05-18 12:01:08 PDT
Comment on attachment 310453 [details] Patch Was able to confirm that this will fix the problems Chris and Ryan were having. The servers are not shut-down until retries are finished.
Jonathan Bedard
Comment 13 2017-05-18 15:57:31 PDT
https://bugs.webkit.org/show_bug.cgi?id=172322 will cause failures like the ones Chris and Ryan were seeing to be logged in the future.
Jonathan Bedard
Comment 14 2017-05-19 11:35:51 PDT
Jonathan Bedard
Comment 15 2017-05-30 11:20:58 PDT
Dean Johnson
Comment 16 2017-05-30 11:26:57 PDT
Comment on attachment 311520 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=311520&action=review > Tools/Scripts/webkitpy/port/base.py:980 > + return bool(self._web_platform_test_server) We should do our best to check the system to see if the WPT server is running, as compared to relying on Python's object state. We want to absolutely ensure there is no way these return invalid information given how these servers are used, and the bug with servers not running resulting in all passing tests (not sure if that one was fixed yet). Can you find a more concrete way to see if the server is running on the system?
Jonathan Bedard
Comment 17 2017-05-30 11:49:10 PDT
Jonathan Bedard
Comment 18 2017-05-30 11:50:21 PDT
(In reply to Dean Johnson from comment #16) > Comment on attachment 311520 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=311520&action=review > > > Tools/Scripts/webkitpy/port/base.py:980 > > + return bool(self._web_platform_test_server) > > We should do our best to check the system to see if the WPT server is > running, as compared to relying on Python's object state. We want to > absolutely ensure there is no way these return invalid information given how > these servers are used, and the bug with servers not running resulting in > all passing tests (not sure if that one was fixed yet). > > Can you find a more concrete way to see if the server is running on the > system? I was actually checking web-platform sockets twice. I needed to check the web socket server. attachment 311523 [details] should work correctly.
Jonathan Bedard
Comment 19 2017-05-30 12:07:28 PDT
WebKit Commit Bot
Comment 20 2017-05-30 14:08:14 PDT
Comment on attachment 311526 [details] Patch Clearing flags on attachment: 311526 Committed r217572: <http://trac.webkit.org/changeset/217572>
WebKit Commit Bot
Comment 21 2017-05-30 14:08:16 PDT
All reviewed patches have been landed. Closing bug.
Daniel Bates
Comment 22 2018-02-01 09:30:41 PST
This patch (In reply to WebKit Commit Bot from comment #20) > Comment on attachment 311526 [details] > Patch > > Clearing flags on attachment: 311526 > > Committed r217572: <http://trac.webkit.org/changeset/217572> This change does more than start servers earlier when running run-webkit-tests. Following this change run-webkit-tests no longer tries to start up servers if servers are already running on the machine. This has the side benefit that it is possible to invoke run-webkit-tests while run-webkit-httpd is running and run-webkit-tests will use the servers started by run-webkit-httpd. Prior to this change, run-webkit-tests would stop the HTTP server started by run-webkit-httpd and die with an exception when trying to start the web socket servers due to the ports being in use.
Daniel Bates
Comment 23 2018-02-01 09:33:36 PST
(In reply to WebKit Commit Bot from comment #20) > Comment on attachment 311526 [details] > Patch > > Clearing flags on attachment: 311526 > > Committed r217572: <http://trac.webkit.org/changeset/217572> This change caused run-webkit-tests to stop all servers twice and exit without printing a newline character following the printing of a log message telling a person that it was stopping the last server. See bug #182360.
Carlos Alberto Lopez Perez
Comment 24 2020-06-01 18:32:08 PDT
(In reply to Daniel Bates from comment #22) > This patch (In reply to WebKit Commit Bot from comment #20) > > Comment on attachment 311526 [details] > > Patch > > > > Clearing flags on attachment: 311526 > > > > Committed r217572: <http://trac.webkit.org/changeset/217572> > > This change does more than start servers earlier when running > run-webkit-tests. Following this change run-webkit-tests no longer tries to > start up servers if servers are already running on the machine. This has the > side benefit that it is possible to invoke run-webkit-tests while > run-webkit-httpd is running and run-webkit-tests will use the servers > started by run-webkit-httpd. Prior to this change, run-webkit-tests would > stop the HTTP server started by run-webkit-httpd and die with an exception > when trying to start the web socket servers due to the ports being in use. I think this new behavior is problematic and can cause hard-to-diagnose problems, for example if the user is running other services than the webkit-test-servers on this ports. I have opened bug 212622 for trying to fix this.
Note You need to log in before you can comment on or make changes to this bug.