Bug 61088

Summary: run-api-tests should run one test per process
Product: WebKit Reporter: Dmitry Lomov <dslomov>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, commit-queue, dbates, dslomov, eric, levin, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 48043    
Attachments:
Description Flags
Restoring "running test one-by-one" logic
none
Small formatting issue
aroben: review+, aroben: commit-queue-
CR feedback
dslomov: commit-queue-
CR feedback++
dslomov: commit-queue-
CR feedback++++
none
Extra bit of feedback - dealing with return code none

Description Dmitry Lomov 2011-05-18 12:55:46 PDT
It currently runs all tests in the same process. This:
1) Makes (future) hang detection difficult
2) Does not isolate tests well
3) Precludes (future) test execution parallelization
Comment 1 Dmitry Lomov 2011-05-18 12:58:59 PDT
Created attachment 93972 [details]
Restoring "running test one-by-one" logic
Comment 2 Dmitry Lomov 2011-05-18 13:01:37 PDT
Created attachment 93974 [details]
Small formatting issue
Comment 3 Eric Seidel (no email) 2011-05-19 10:34:04 PDT
OMG perl.
Comment 4 Adam Roben (:aroben) 2011-05-19 13:57:21 PDT
Comment on attachment 93974 [details]
Small formatting issue

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

> Tools/ChangeLog:8
> +2011-05-18  Dmitry Lomov  <dslomov@google.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        run-api-tests should run one test per process
> +        https://bugs.webkit.org/show_bug.cgi?id=61088
> +
> +        * Scripts/run-api-tests:

It would be good to have some more comments in here explaining where this code came from. I assume a lot of it is from an older version of run-api-tests.

> Tools/Scripts/run-api-tests:86
> +if (runAllTests()) {
> +    exit 1;
> +}
> +else {
> +    exit 0;
> +}

"else" should be on the same line as "}". But there's no need for "else" after "exit".

> Tools/Scripts/run-api-tests:181
> +    f ($result == 0) {

"f"?

We normally say "!$result" instead of "$result == 0".

> Tools/Scripts/run-api-tests:207
> +        unless ($verbose) {
> +            open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
> +            $childErr = ">&DEVNULL";
> +        } else {
> +            $childErr = ">&STDERR";
> +        }

I find "unless/else" confusing. "if/else" hurts my tiny head much less.

> Tools/Scripts/run-api-tests:297
> -
> +    

You should undo this change.
Comment 5 Dmitry Lomov 2011-05-19 14:13:00 PDT
Created attachment 94113 [details]
CR feedback
Comment 6 Dmitry Lomov 2011-05-19 14:17:24 PDT
Created attachment 94115 [details]
CR feedback++
Comment 7 Daniel Bates 2011-05-19 14:22:56 PDT
Comment on attachment 94115 [details]
CR feedback++

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

> Tools/Scripts/run-api-tests:39
> +use Term::ANSIColor qw(:constants);

Is this part of the standard Perl distribution?  From briefly googling, I came across <http://perldoc.perl.org/perlfaq8.html#How-do-I-do-fancy-stuff-with-the-keyboard%2fscreen%2fmouse%3f>, which states that it isn't. That being said, Mac OS 10 10.6.7 includes this Perl module. We should also look to see if the WebKit Cgywin distribution (for WebKit Windows development) downloads and installs this module. I take it from Adam Roben's review that this module is included in our Cgywin distribution. Even better, can we make this module optional since it only affects the visual appearance of the output?

> Tools/Scripts/run-api-tests:45
> -sub runTestTool(@);
> +sub dumpAllTests();
> +sub runAllTests();
> +sub runAllTestsInSuite($);
> +sub runTest($$);
> +sub populateTests();

Nit: Can we sort these?

> Tools/Scripts/run-api-tests:86
> +if (runAllTests()) {
> +    exit 1;
> +}
> +else {
> +    exit 0;
> +}

I would write this in one-line:

exit(runAllTests() > 0);
Comment 8 Dmitry Lomov 2011-05-19 14:29:10 PDT
Comment on attachment 94115 [details]
CR feedback++

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

>> Tools/Scripts/run-api-tests:39
>> +use Term::ANSIColor qw(:constants);
> 
> Is this part of the standard Perl distribution?  From briefly googling, I came across <http://perldoc.perl.org/perlfaq8.html#How-do-I-do-fancy-stuff-with-the-keyboard%2fscreen%2fmouse%3f>, which states that it isn't. That being said, Mac OS 10 10.6.7 includes this Perl module. We should also look to see if the WebKit Cgywin distribution (for WebKit Windows development) downloads and installs this module. I take it from Adam Roben's review that this module is included in our Cgywin distribution. Even better, can we make this module optional since it only affects the visual appearance of the output?

This has been there in original run-api-tests. This works on mac and and cygwin. I can remove this dependency, but maybe not in this checkin?

>> Tools/Scripts/run-api-tests:45
>> +sub populateTests();
> 
> Nit: Can we sort these?

Again, comes from original run-api-tests, but good call - I'll sort.

>> Tools/Scripts/run-api-tests:86
>> +}
> 
> I would write this in one-line:
> 
> exit(runAllTests() > 0);

Hmm, my tiny brain has a hard time reasoning about integer->boolean->integer conversions...
Comment 9 Dmitry Lomov 2011-05-19 14:35:01 PDT
Created attachment 94117 [details]
CR feedback++++
Comment 10 Dmitry Lomov 2011-05-19 14:52:41 PDT
Created attachment 94124 [details]
Extra bit of feedback - dealing with return code
Comment 11 WebKit Commit Bot 2011-05-19 17:11:10 PDT
The commit-queue encountered the following flaky tests while processing attachment 94124 [details]:

java/lc3/JavaObject/JavaObjectToByte-006.html bug 60333 (author: ap@webkit.org)
The commit-queue is continuing to process your patch.
Comment 12 WebKit Commit Bot 2011-05-19 17:12:43 PDT
Comment on attachment 94124 [details]
Extra bit of feedback - dealing with return code

Clearing flags on attachment: 94124

Committed r86907: <http://trac.webkit.org/changeset/86907>
Comment 13 WebKit Commit Bot 2011-05-19 17:12:49 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 WebKit Commit Bot 2011-05-19 19:10:37 PDT
The commit-queue encountered the following flaky tests while processing attachment 94124 [details]:

http/tests/inspector/console-websocket-error.html bug 57392 (authors: pfeldman@chromium.org and yutak@chromium.org)
The commit-queue is continuing to process your patch.