Bug 59078

Summary: Reftests should be skipped if pixel tests are disabled.
Product: WebKit Reporter: Hayato Ito <hayato>
Component: Tools / TestsAssignee: Hayato Ito <hayato>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, aroben, dpranke, eric, ojan, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 36065    
Attachments:
Description Flags
skip-reftests-if-pixel-tests-are-disabled
none
update1 ojan: review+

Description Hayato Ito 2011-04-20 23:34:53 PDT
We should skip reftests when pixel tests are disabled in new-run-webkit-tests.
i.e. a '--no-pixel-tests' is given as a command line option.
Comment 1 Hayato Ito 2011-04-20 23:38:15 PDT
Maybe, adding a new option for reftests is better than re-using 'pixel-tests' option.
Comment 2 Hayato Ito 2011-04-22 04:25:26 PDT
Created attachment 90690 [details]
skip-reftests-if-pixel-tests-are-disabled
Comment 3 Hayato Ito 2011-04-22 04:29:05 PDT
Until we have a new option which is specific to reftests, we should respect 'pixel-tests' option whether we execute reftests or not.
Comment 4 Ojan Vafai 2011-04-26 16:27:00 PDT
Comment on attachment 90690 [details]
skip-reftests-if-pixel-tests-are-disabled

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

> Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py:254
> +            reftests_files = set(test_file for test_file in self._test_files if self._port.is_reftest(test_file))
> +            self._printer.print_expected('%d reftests will be skipped because pixel tests are disabled.' % len(reftests_files))
> +            self._test_files -= reftests_files

This is a lot of file-system reading just to determine a small number of tests to read. The problem is that we're blocking running any tests on this. I'd rather we not spit out the number of tests skipped and instead skip the test when we're about to run it.
Comment 5 Hayato Ito 2011-05-09 04:36:56 PDT
Created attachment 92780 [details]
update1
Comment 6 Hayato Ito 2011-05-09 04:38:23 PDT
That's a nice point. Actually, the code took about 6 seconds on my machine if we try to run tests for 'LayoutTest/' directory. This is unacceptable, I guess.

I updated the patch so that it skips reftests when we're about to run it.


(In reply to comment #4)
> (From update of attachment 90690 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=90690&action=review
> 
> > Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py:254
> > +            reftests_files = set(test_file for test_file in self._test_files if self._port.is_reftest(test_file))
> > +            self._printer.print_expected('%d reftests will be skipped because pixel tests are disabled.' % len(reftests_files))
> > +            self._test_files -= reftests_files
> 
> This is a lot of file-system reading just to determine a small number of tests to read. The problem is that we're blocking running any tests on this. I'd rather we not spit out the number of tests skipped and instead skip the test when we're about to run it.
Comment 7 Ojan Vafai 2011-05-09 08:43:26 PDT
Comment on attachment 92780 [details]
update1

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

> Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py:122
> +            # Skips reftests if pixel tests are disabled.

This comment isn't very useful. It just describes what the code does. I think it's fine to just delete it.
Comment 8 Hayato Ito 2011-05-09 19:37:51 PDT
Thank you for the review. I'll land the patch after deleting the comment.

(In reply to comment #7)
> (From update of attachment 92780 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=92780&action=review
> 
> > Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py:122
> > +            # Skips reftests if pixel tests are disabled.
> 
> This comment isn't very useful. It just describes what the code does. I think it's fine to just delete it.
Comment 9 Hayato Ito 2011-05-09 19:40:53 PDT
Committed r86126: <http://trac.webkit.org/changeset/86126>
Comment 10 WebKit Review Bot 2011-05-09 20:25:55 PDT
http://trac.webkit.org/changeset/86126 might have broken GTK Linux 32-bit Release
Comment 11 Eric Seidel (no email) 2011-05-09 20:34:48 PDT
Why would disabling pixel tests disable ref-tests?  Are reftests slow?
Comment 12 Hayato Ito 2011-05-09 20:51:59 PDT
I agree that it is confusing that the 'pixel tests' option affects 'reftests'.
That is not an ideal situation. Let me explain the reason.

Reftests are similar to 'pixel tests' in concept. In fact, reftests are implementd in a very similar way to 'pixel tests'.
In the current implementation, reftests relies on 'pixel test' mechanism. So disabling pixel tests break reftests.

I don't think this is an ideal situation. I appreciate if you could consider this is a temporary solution.
We should have a better solution, such as a dedicated a command line option for reftests.

(In reply to comment #11)
> Why would disabling pixel tests disable ref-tests?  Are reftests slow?
Comment 13 Adam Roben (:aroben) 2011-05-10 06:38:37 PDT
(In reply to comment #12)
> I agree that it is confusing that the 'pixel tests' option affects 'reftests'.
> That is not an ideal situation. Let me explain the reason.
> 
> Reftests are similar to 'pixel tests' in concept. In fact, reftests are implementd in a very similar way to 'pixel tests'.
> In the current implementation, reftests relies on 'pixel test' mechanism. So disabling pixel tests break reftests.
> 
> I don't think this is an ideal situation. I appreciate if you could consider this is a temporary solution.
> We should have a better solution, such as a dedicated a command line option for retests.

This reasoning seems a little off to me. Even though pixel tests and reftests are similar from an implementation standpoint, they are not at all similar from a user standpoint. And the user is what matters for command-line options.

Pixel tests are typically disabled for some combination of the following reasons:
1) They tend to give a lot of false failures
2) They slow down test runs

Presumably (1) does not apply to reftests. (Indeed, that's the whole point!) Does (2) apply, as Eric asked above?

If (2) does apply, then it probably makes sense to have a --no-reftests option. Regardless of whether (2) applies, I don't think it makes sense to lump reftests in with pixel tests. They are very different!
Comment 14 Dirk Pranke 2011-05-10 10:10:12 PDT
I agree with Adam and Eric. The whole point of reftests is that we should be able to use them when we don't want pixel tests but do care about the graphical output, so we shouldn't be disabling them when we disable pixel tests. 

As to them being slow, logically they'll be a little less than twice as slow as a regular test, but given that we have all of about three of them in the tree, I don't think this is a significant concern at this point. Plus, I'm not a big fan of disabling or skipping tests because they're slow, period.
Comment 15 Adam Roben (:aroben) 2011-05-10 10:15:21 PDT
I agree with Dirk. Though I listed slowness as a reason for pixel tests being disabled, I doubt that is the primary reason. (I think false failures is the primary reason.)
Comment 16 Hayato Ito 2011-05-10 19:20:34 PDT
I totally agree. This patch is a just a quick fix for 'reftest breakage'. 
I just thought that skipping reftests is better than giving wrong test results until we have a dedicated command line option and fix internal implementations.

I'll file a another bug to modify the current implementation so that reftests seems to be independent from 'pixel tests'.

(In reply to comment #15)
> I agree with Dirk. Though I listed slowness as a reason for pixel tests being disabled, I doubt that is the primary reason. (I think false failures is the primary reason.)

(In reply to comment #13)
> (In reply to comment #12)
> > I agree that it is confusing that the 'pixel tests' option affects 'reftests'.
> > That is not an ideal situation. Let me explain the reason.
> > 
> > Reftests are similar to 'pixel tests' in concept. In fact, reftests are implementd in a very similar way to 'pixel tests'.
> > In the current implementation, reftests relies on 'pixel test' mechanism. So disabling pixel tests break reftests.
> > 
> > I don't think this is an ideal situation. I appreciate if you could consider this is a temporary solution.
> > We should have a better solution, such as a dedicated a command line option for retests.
> 
> This reasoning seems a little off to me. Even though pixel tests and reftests are similar from an implementation standpoint, they are not at all similar from a user standpoint. And the user is what matters for command-line options.
> 
> Pixel tests are typically disabled for some combination of the following reasons:
> 1) They tend to give a lot of false failures
> 2) They slow down test runs
> 
> Presumably (1) does not apply to reftests. (Indeed, that's the whole point!) Does (2) apply, as Eric asked above?
> 
> If (2) does apply, then it probably makes sense to have a --no-reftests option. Regardless of whether (2) applies, I don't think it makes sense to lump reftests in with pixel tests. They are very different!
Comment 17 Hayato Ito 2011-05-10 20:20:19 PDT
Filed as https://bugs.webkit.org/show_bug.cgi?id=60605.

(In reply to comment #16)
> I totally agree. This patch is a just a quick fix for 'reftest breakage'. 
> I just thought that skipping reftests is better than giving wrong test results until we have a dedicated command line option and fix internal implementations.
> 
> I'll file a another bug to modify the current implementation so that reftests seems to be independent from 'pixel tests'.
> 
> (In reply to comment #15)
> > I agree with Dirk. Though I listed slowness as a reason for pixel tests being disabled, I doubt that is the primary reason. (I think false failures is the primary reason.)
> 
> (In reply to comment #13)
> > (In reply to comment #12)
> > > I agree that it is confusing that the 'pixel tests' option affects 'reftests'.
> > > That is not an ideal situation. Let me explain the reason.
> > > 
> > > Reftests are similar to 'pixel tests' in concept. In fact, reftests are implementd in a very similar way to 'pixel tests'.
> > > In the current implementation, reftests relies on 'pixel test' mechanism. So disabling pixel tests break reftests.
> > > 
> > > I don't think this is an ideal situation. I appreciate if you could consider this is a temporary solution.
> > > We should have a better solution, such as a dedicated a command line option for retests.
> > 
> > This reasoning seems a little off to me. Even though pixel tests and reftests are similar from an implementation standpoint, they are not at all similar from a user standpoint. And the user is what matters for command-line options.
> > 
> > Pixel tests are typically disabled for some combination of the following reasons:
> > 1) They tend to give a lot of false failures
> > 2) They slow down test runs
> > 
> > Presumably (1) does not apply to reftests. (Indeed, that's the whole point!) Does (2) apply, as Eric asked above?
> > 
> > If (2) does apply, then it probably makes sense to have a --no-reftests option. Regardless of whether (2) applies, I don't think it makes sense to lump reftests in with pixel tests. They are very different!