Changeset 121394 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Jun 27, 2012, 6:14:20 PM (13 years ago)
Author:
[email protected]
Message:

[Win] jscore-tests flakey
https://bugs.webkit.org/show_bug.cgi?id=88118

Reviewed by Jessie Berlin.

jsDriver.pl on windows intermittently doesn't get the returned value from jsc,
instead it gets 126. Added a new option to jsc (-x) which prints the exit
code before exiting. jsDriver.pl uses this option on Windows and parses the
exit code output for the exit code, removing it before comparing the actual
and expected outputs. Filed a follow on "FIXME" defect:
[WIN] Intermittent failure for jsc return value to propagate through jsDriver.pl
https://bugs.webkit.org/show_bug.cgi?id=90119

  • jsc.cpp:

(CommandLine::CommandLine):
(CommandLine):
(printUsageStatement):
(parseArguments):
(jscmain):

  • tests/mozilla/jsDriver.pl:

(execute_tests):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r121393 r121394  
     12012-06-27  Michael Saboff  <[email protected]>
     2
     3        [Win] jscore-tests flakey
     4        https://bugs.webkit.org/show_bug.cgi?id=88118
     5
     6        Reviewed by Jessie Berlin.
     7
     8        jsDriver.pl on windows intermittently doesn't get the returned value from jsc,
     9        instead it gets 126.  Added a new option to jsc (-x) which prints the exit
     10        code before exiting.  jsDriver.pl uses this option on Windows and parses the
     11        exit code output for the exit code, removing it before comparing the actual
     12        and expected outputs.  Filed a follow on "FIXME" defect:
     13        [WIN] Intermittent failure for jsc return value to propagate through jsDriver.pl
     14        https://bugs.webkit.org/show_bug.cgi?id=90119
     15
     16        * jsc.cpp:
     17        (CommandLine::CommandLine):
     18        (CommandLine):
     19        (printUsageStatement):
     20        (parseArguments):
     21        (jscmain):
     22        * tests/mozilla/jsDriver.pl:
     23        (execute_tests):
     24
    1252012-06-27  Sheriff Bot  <[email protected]>
    226
  • trunk/Source/JavaScriptCore/jsc.cpp

    r121381 r121394  
    118118        : interactive(false)
    119119        , dump(false)
     120        , exitCode(false)
    120121    {
    121122    }
     
    123124    bool interactive;
    124125    bool dump;
     126    bool exitCode;
    125127    Vector<Script> scripts;
    126128    Vector<UString> arguments;
     
    612614    fprintf(stderr, "  -s         Installs signal handlers that exit on a crash (Unix platforms only)\n");
    613615#endif
     616    fprintf(stderr, "  -x         Output exit code before terminating\n");
    614617
    615618    exit(help ? EXIT_SUCCESS : EXIT_FAILURE);
     
    650653            continue;
    651654        }
     655        if (!strcmp(arg, "-x")) {
     656            options.exitCode = true;
     657            continue;
     658        }
    652659        if (!strcmp(arg, "--")) {
    653660            ++i;
     
    668675int jscmain(int argc, char** argv)
    669676{
    670    
    671677    RefPtr<JSGlobalData> globalData = JSGlobalData::create(ThreadStackTypeLarge, LargeHeap);
    672678    JSLockHolder lock(globalData.get());
     679    int result;
    673680
    674681    CommandLine options;
     
    680687        runInteractive(globalObject);
    681688
    682     return success ? 0 : 3;
     689    result = success ? 0 : 3;
     690
     691    if (options.exitCode)
     692        printf("jsc exiting %d\n", result);
     693
     694    return result;
    683695}
    684696
  • trunk/Source/JavaScriptCore/tests/mozilla/jsDriver.pl

    r36607 r121394  
    165165        my $bug_number;
    166166        my $status_lines;
     167        my @jsc_exit_code;
    167168       
    168169# user selected [Q]uit from ^C handler.
     
    178179           
    179180            $shell_command .= &xp_path($engine_command)  . " -s ";
    180            
     181
     182# FIXME: <https://bugs.webkit.org/show_bug.cgi?id=90119>
     183# Sporadically on Windows, the exit code returned after close() in $?
     184# is 126 (after the appropraite shifting, even though jsc exits with
     185# 0 or 3). To work around this, a -x option was added to jsc that will
     186# output the exit value right before exiting.  We parse that value and
     187# remove it from the output stream before comparing the actual and expected
     188# outputs. When that bug is found and fixed, the code for processing of
     189# "jsc exiting [\d]" and use of @jsc_exit_code can be removed along with
     190# the -x option in jsc.cpp
     191            if ($os_type eq "WIN") {
     192                $shell_command .= " -x ";
     193            }
     194
    181195            $path = &xp_path($opt_suite_path . $suite . "/shell.js");
    182196            if (-f $path) {
     
    203217        @output = <OUTPUT>;
    204218        close (OUTPUT);
    205        
    206         @output = grep (!/js\>/, @output);
    207        
    208         if ($opt_exit_munge == 1) {
     219
     220        @jsc_exit_code = grep (/jsc exiting [\d]/, @output);
     221        @output = grep (!/js\>|jsc exiting [\d]/, @output);
     222
     223        if (($#jsc_exit_code == 0) && ($jsc_exit_code[0] =~ /jsc exiting ([\d])\W*/)) {
     224# return value from jsc output to work around windows bug
     225            $got_exit = $1;
     226            if ($opt_exit_munge == 1) {
     227                $exit_signal = ($? & 255);
     228            } else {
     229                $exit_signal = 0;
     230            }
     231        } elsif ($opt_exit_munge == 1) {
    209232# signal information in the lower 8 bits, exit code above that
    210233            $got_exit = ($? >> 8);
Note: See TracChangeset for help on using the changeset viewer.