Bug 205875

Summary: run-webkit-tests: clobber-old-results should remove the entire results folder
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, ap, commit-queue, ews-watchlist, glenn, simon.fraser, slewis, tsavell, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 205981    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing
none
Patch
none
Patch
none
Patch
none
Patch none

Description Jonathan Bedard 2020-01-07 11:38:19 PST
In automation, we want to clear out the entirety of the results folder when --clobber-old-results is passed. In particular, we want to remove timeout and crash logs.
Comment 1 Jonathan Bedard 2020-01-07 11:38:56 PST
<rdar://problem/58236117>
Comment 2 Jonathan Bedard 2020-01-07 11:42:20 PST
Created attachment 387007 [details]
Patch
Comment 3 Alexey Proskuryakov 2020-01-07 13:53:34 PST
Comment on attachment 387007 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387007&action=review

> Tools/ChangeLog:3
> +        run-webki-tests: clobber-old-results should remove the entire results folder

run-webkit-tests

> Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:-462
> -        # files in the results directory are explicitly used for cross-run
> -        # tracking.

What is this "cross-run tracking"? Is it about saving results for a retry?

Without having thought about the code much, I wonder if the patch makes it so that orginal results will be deleted when using --retry (which is the default).
Comment 4 Alexey Proskuryakov 2020-01-07 13:53:55 PST
Or when running iPad tests after the main suite.
Comment 5 Jonathan Bedard 2020-01-07 14:08:37 PST
(In reply to Alexey Proskuryakov from comment #3)
> Comment on attachment 387007 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=387007&action=review
> 
> > Tools/ChangeLog:3
> > +        run-webki-tests: clobber-old-results should remove the entire results folder
> 
> run-webkit-tests
> 
> > Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:-462
> > -        # files in the results directory are explicitly used for cross-run
> > -        # tracking.
> 
> What is this "cross-run tracking"? Is it about saving results for a retry?
> 
> Without having thought about the code much, I wonder if the patch makes it
> so that orginal results will be deleted when using --retry (which is the
> default).

I'm not really sure what this was originally referring to, but I can't see it being anything except undesirable when passing --clobber-old-results.

_clobber_old_results is run before all the rounds, so this doesn't effect results on iOS where we have separate iPhone/iPad rounds.

Another approach we could take its only deleting crashlogs, python stack traces and spindumps instead of the entire directory. The problem with that approach is that I still can't think of a reason why keeping any result data between tests would ever be useful in infrastructure, especially since sometimes we build out of order.
Comment 6 Jonathan Bedard 2020-01-07 14:19:05 PST
Created attachment 387032 [details]
Patch
Comment 7 Alexey Proskuryakov 2020-01-07 14:32:51 PST
Comment on attachment 387032 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387032&action=review

Yes, I also don't remember any files or run-webkit-tests modes where we wanted to keep any files in the results directory between invocations.

> Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:628
> -        # Now we test that --clobber-old-results does remove the old entries and the old retries,
> -        # and that we don't retry again.
> +        # Now we test that --clobber-old-results does remove the old entries and the old retries

Please keep the period at the end of the sentence.
Comment 8 Jonathan Bedard 2020-01-07 14:41:06 PST
Created attachment 387035 [details]
Patch for landing
Comment 9 WebKit Commit Bot 2020-01-07 15:54:42 PST
Comment on attachment 387035 [details]
Patch for landing

Clearing flags on attachment: 387035

Committed r254165: <https://trac.webkit.org/changeset/254165>
Comment 10 WebKit Commit Bot 2020-01-07 15:54:43 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Truitt Savell 2020-01-07 16:41:40 PST
Reverted r254165 for reason:

Caused 500+ missing results on Mac

Committed r254176: <https://trac.webkit.org/changeset/254176>
Comment 12 Jonathan Bedard 2020-01-08 07:11:37 PST
I guess we have our answer. We are using the previous test results to detect when certain tests (compositing, in particular) change their output. This seems like a very unstable way of doing things.
Comment 13 Jonathan Bedard 2020-01-08 13:33:32 PST
(In reply to Jonathan Bedard from comment #12)
> I guess we have our answer. We are using the previous test results to detect
> when certain tests (compositing, in particular) change their output. This
> seems like a very unstable way of doing things.

Probably would have helped to actually delete the right thing.

The previous patch was deleting WebKit/LayoutTests instead of WebKit/build/*/layout-test-results.
Comment 14 Jonathan Bedard 2020-01-08 13:36:23 PST
Created attachment 387134 [details]
Patch
Comment 15 WebKit Commit Bot 2020-01-08 16:31:06 PST
Comment on attachment 387134 [details]
Patch

Clearing flags on attachment: 387134

Committed r254235: <https://trac.webkit.org/changeset/254235>
Comment 16 WebKit Commit Bot 2020-01-08 16:31:08 PST
All reviewed patches have been landed.  Closing bug.
Comment 17 Aakash Jain 2020-01-08 18:19:50 PST
This seems to have broken the layout-tests completely.

https://build.webkit.org/builders/Apple%20High%20Sierra%20Release%20WK1%20%28Tests%29/builds/18157

https://build.webkit.org/builders/Apple%20Mojave%20Release%20WK2%20%28Tests%29/builds/9327

17:22:50.857 39532 Stopping HTTP server ...
17:22:50.859 39532 Attempting to shut down httpd server at pid 39550

ServerError raised: Failed to stop httpd: httpd: Could not open configuration file /Volumes/Data/slave/mojave-release-tests-wk2/build/layout-test-results/httpd.conf: No such file or directory
 (exit code=None)
Traceback (most recent call last):
  File "/Volumes/Data/slave/mojave-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py", line 91, in main
    run_details = run(port, options, args, stderr)
  File "/Volumes/Data/slave/mojave-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py", line 485, in run
    run_details = manager.run(args)
  File "/Volumes/Data/slave/mojave-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py", line 314, in run
    self._runner.stop_servers()
  File "/Volumes/Data/slave/mojave-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py", line 230, in stop_servers
    self._port.stop_http_server()
  File "/Volumes/Data/slave/mojave-release-tests-wk2/build/Tools/Scripts/webkitpy/port/base.py", line 1063, in stop_http_server
    self._http_server.stop()
  File "/Volumes/Data/slave/mojave-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py", line 134, in stop
    self._stop_running_server()
  File "/Volumes/Data/slave/mojave-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py", line 209, in _stop_running_server
    raise self._server_error('Failed to stop %s' % self._name, err, retval)
ServerError: Failed to stop httpd: httpd: Could not open configuration file /Volumes/Data/slave/mojave-release-tests-wk2/build/layout-test-results/httpd.conf: No such file or directory
 (exit code=None)
Comment 18 WebKit Commit Bot 2020-01-08 18:21:44 PST
Re-opened since this is blocked by bug 205981
Comment 19 Alexey Proskuryakov 2020-01-08 19:55:04 PST
Next time, please wait for EWS.
Comment 20 Jonathan Bedard 2020-01-09 07:53:56 PST
Sorry about that....we apparently clobber results after starting the HTTP server.
Comment 21 Jonathan Bedard 2020-01-09 08:17:17 PST
Created attachment 387232 [details]
Patch
Comment 22 Alexey Proskuryakov 2020-01-27 16:08:51 PST
Comment on attachment 387232 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387232&action=review

> Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:460
> +        self._printer.write_update("Clobbering all results in {}".format(self._results_directory))

I think that you can just as well say "deleting directory" now, as it's no longer about just results.
Comment 23 Jonathan Bedard 2020-01-27 16:56:12 PST
Created attachment 388941 [details]
Patch
Comment 24 Jonathan Bedard 2020-01-27 17:13:34 PST
Created attachment 388945 [details]
Patch
Comment 25 WebKit Commit Bot 2020-01-28 08:46:34 PST
Comment on attachment 388945 [details]
Patch

Clearing flags on attachment: 388945

Committed r255240: <https://trac.webkit.org/changeset/255240>
Comment 26 WebKit Commit Bot 2020-01-28 08:46:36 PST
All reviewed patches have been landed.  Closing bug.