Bug 37739 - new-run-webkit-tests does not report stderr output
Summary: new-run-webkit-tests does not report stderr output
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
: 37422 (view as bug list)
Depends on: 58690 58708
Blocks: 34984
  Show dependency treegraph
 
Reported: 2010-04-16 17:36 PDT by Maciej Stachowiak
Modified: 2011-06-27 15:37 PDT (History)
6 users (show)

See Also:


Attachments
Work in progress (6.23 KB, patch)
2011-06-27 02:17 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch (7.22 KB, patch)
2011-06-27 02:27 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch (9.92 KB, patch)
2011-06-27 13:56 PDT, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2010-04-16 17:36:44 PDT
new-run-webkit-tests does not report stderr output. This could make it slightly harder to diagnose failures.
Comment 1 Dirk Pranke 2010-04-16 18:15:07 PDT
Yup. Note that the stderr output does get logged to the --verbose log (which has been sufficient for the Chromium tree), but I have no argument against adding this feature for better old-run-webkit-tests compatibility.
Comment 2 Eric Seidel (no email) 2010-04-16 18:18:01 PDT
old-run-webkit-tests keeps  a per-test stderr log.  We mostly ignore this log (a zillion tests print to stderr which shouldn't really).  However it's very useful for diagnosing failures (when lower system libraries log things).  Qt and Gtk use it for printing stack traces and all webkit versions log ASSERT failures there.
Comment 3 Ojan Vafai 2010-04-19 07:23:24 PDT
TestShell has stderr output going into the test results. Personally, I think this is better since it means that stderr output doesn't get ignored. Maybe DRT should do the same?
Comment 4 Ojan Vafai 2010-04-21 11:22:19 PDT
*** Bug 37422 has been marked as a duplicate of this bug. ***
Comment 5 Maciej Stachowiak 2011-03-20 21:00:37 PDT
(In reply to comment #3)
> TestShell has stderr output going into the test results. Personally, I think this is better since it means that stderr output doesn't get ignored. Maybe DRT should do the same?

We used to do this, but sometimes there are random changes in std err that we can't easily control, for example due to logging by new versions of Mac OS X system frameworks.

Nontheless, when a test does fail, stderr output is often useful to diagnose what happened.
Comment 6 Adam Barth 2011-06-27 02:17:31 PDT
Created attachment 98687 [details]
Work in progress
Comment 7 Adam Barth 2011-06-27 02:27:33 PDT
Created attachment 98690 [details]
Patch
Comment 8 Adam Barth 2011-06-27 02:28:18 PDT
I don't know how to wrote a test for this patch.  If someone would be willing to give me some pointers, I would very much like to write a test.
Comment 9 Eric Seidel (no email) 2011-06-27 10:28:32 PDT
Comment on attachment 98690 [details]
Patch

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

I suspect it would be possible with on of the integration tests to test this.  There must be one which writes to a mock file system?

> Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py:282
>      def _compare_output_with_reference(self, driver_output1, driver_output2):

I suspect this is an easy function to test.
Comment 10 Dirk Pranke 2011-06-27 13:38:15 PDT
(In reply to comment #8)
> I don't know how to wrote a test for this patch.  If someone would be willing to give me some pointers, I would very much like to write a test.

There's perhaps three things to verify. The first is that the -stderr.txt file does get written to the output directory. The first is already being done (see test_stderr_is_saved() in run_webkit_tests_integrationtest).

The second is that some indicator was stuffed into the results.json file. I'd probably modify the above test to verify that as well (you'd have to read and take apart the results.json file).

The third is to verify that the results.html javascript will display the links properly if the entry is in the json file; I don't really know how we test that stuff, but it probably won't work right with the mock filesystem. Maybe Ojan is already testing this elsewhere?
Comment 11 Adam Barth 2011-06-27 13:52:36 PDT
Thanks!  I think I've got at least a minimal test working.
Comment 12 Adam Barth 2011-06-27 13:56:13 PDT
Created attachment 98779 [details]
Patch
Comment 13 Dirk Pranke 2011-06-27 14:00:45 PDT
Comment on attachment 98779 [details]
Patch

Does the crash actually affect any of the behavior? I would think it wouldn't, and you could reuse/modify the test I mentioned rather than adding a new test file.
Comment 14 Adam Barth 2011-06-27 14:05:57 PDT
> Does the crash actually affect any of the behavior? I would think it wouldn't, and you could reuse/modify the test I mentioned rather than adding a new test file.

My understanding is that I need an unexpected failure for the test to show up in unexpected.json.
Comment 15 Adam Barth 2011-06-27 14:06:12 PDT
unexpected_results.json
Comment 16 Dirk Pranke 2011-06-27 14:13:22 PDT
(In reply to comment #15)
> unexpected_results.json

Ah. True.
Comment 17 Dirk Pranke 2011-06-27 14:15:49 PDT
Comment on attachment 98779 [details]
Patch

I suppose technically you might want to verify that the stderr is showing up in full_results.json as well, but I'm not actually sure if we care about that.

I had kinda lost track of how many different json files we were saving and still using.
Comment 18 Eric Seidel (no email) 2011-06-27 14:16:22 PDT
Comment on attachment 98779 [details]
Patch

LGTM.
Comment 19 Adam Barth 2011-06-27 14:18:53 PDT
> I suppose technically you might want to verify that the stderr is showing up in full_results.json as well, but I'm not actually sure if we care about that.
> 
> I had kinda lost track of how many different json files we were saving and still using.

Yeah, the results blob of data is somewhat out of control.  That seems like something to worry about once we've got the blocking issues fixed because it requires someone to wrap their mind around the global problem.
Comment 20 Adam Barth 2011-06-27 14:20:04 PDT
Comment on attachment 98779 [details]
Patch

Clearing flags on attachment: 98779

Committed r89854: <http://trac.webkit.org/changeset/89854>
Comment 21 Adam Barth 2011-06-27 14:20:09 PDT
All reviewed patches have been landed.  Closing bug.
Comment 22 Ojan Vafai 2011-06-27 15:24:01 PDT
(In reply to comment #19)
> > I suppose technically you might want to verify that the stderr is showing up in full_results.json as well, but I'm not actually sure if we care about that.
> > 
> > I had kinda lost track of how many different json files we were saving and still using.
> 
> Yeah, the results blob of data is somewhat out of control.  That seems like something to worry about once we've got the blocking issues fixed because it requires someone to wrap their mind around the global problem.

FWIW, I've been trying to get us to get rid of unexpected_results.json and to only have full_results.json and incremental_results.json, both of which we need. unexpected_results.json is a subset of the data in full_results.json. There's no longer any benefit to having the former.
Comment 23 Adam Barth 2011-06-27 15:26:50 PDT
> FWIW, I've been trying to get us to get rid of unexpected_results.json and to only have full_results.json and incremental_results.json, both of which we need. unexpected_results.json is a subset of the data in full_results.json. There's no longer any benefit to having the former.

Sorry if I've made your job slightly harder.  :-/
Comment 24 Dirk Pranke 2011-06-27 15:28:12 PDT
(In reply to comment #22)
> (In reply to comment #19)
> > > I suppose technically you might want to verify that the stderr is showing up in full_results.json as well, but I'm not actually sure if we care about that.
> > > 
> > > I had kinda lost track of how many different json files we were saving and still using.
> > 
> > Yeah, the results blob of data is somewhat out of control.  That seems like something to worry about once we've got the blocking issues fixed because it requires someone to wrap their mind around the global problem.
> 
> FWIW, I've been trying to get us to get rid of unexpected_results.json and to only have full_results.json and incremental_results.json, both of which we need. unexpected_results.json is a subset of the data in full_results.json. There's no longer any benefit to having the former.

That was what I was thinking, as well. It should be trivial to change the test to pull the data from full_results.json (and then we wouldn't need the unexpected result, either).

Ojan, we also have the test_times.json file, though, right?
Comment 25 Ojan Vafai 2011-06-27 15:37:28 PDT
(In reply to comment #24)
> Ojan, we also have the test_times.json file, though, right?

Lol. Yeah. We'll need to keep that one as well.