Changeset 208925 in webkit


Ignore:
Timestamp:
Nov 19, 2016 9:39:25 AM (7 years ago)
Author:
mark.lam@apple.com
Message:

Add --timeoutMultiplier option to allow some tests more time to run.
https://bugs.webkit.org/show_bug.cgi?id=164951

Reviewed by Yusuke Suzuki.

JSTests:

Extended the timeout for these tests by 50% more because they run quite slow on
low-end machines.

  • stress/op_div-ConstVar.js:
  • stress/op_div-VarConst.js:
  • stress/op_div-VarVar.js:

Source/JavaScriptCore:

  • jsc.cpp:

(timeoutThreadMain):

  • Modified to factor in a timeout multiplier that can adjust the timeout duration.

(startTimeoutThreadIfNeeded):

  • Moved the code that starts the timeout thread here from main() so that we can

call it after command line args have been parsed instead.
(main):

  • Deleted old timeout thread starting code.

(CommandLine::parseArguments):

  • Added parsing of the --timeoutMultiplier option.

(jscmain):

  • Start the timeout thread if needed after we've parsed the command line args.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r208901 r208925  
     12016-11-19  Mark Lam  <mark.lam@apple.com>
     2
     3        Add --timeoutMultiplier option to allow some tests more time to run.
     4        https://bugs.webkit.org/show_bug.cgi?id=164951
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Extended the timeout for these tests by 50% more because they run quite slow on
     9        low-end machines.
     10
     11        * stress/op_div-ConstVar.js:
     12        * stress/op_div-VarConst.js:
     13        * stress/op_div-VarVar.js:
     14
    1152016-11-18  Yusuke Suzuki  <utatane.tea@gmail.com>
    216
  • trunk/JSTests/stress/op_div-ConstVar.js

    r206600 r208925  
    1 //@ runFTLNoCJIT
     1//@ runFTLNoCJIT("--timeoutMultiplier=1.5")
    22
    33// If all goes well, this test module will terminate silently. If not, it will print
  • trunk/JSTests/stress/op_div-VarConst.js

    r206600 r208925  
    1 //@ runFTLNoCJIT
     1//@ runFTLNoCJIT("--timeoutMultiplier=1.5")
    22
    33// If all goes well, this test module will terminate silently. If not, it will print
  • trunk/JSTests/stress/op_div-VarVar.js

    r206600 r208925  
    1 //@ runFTLNoCJIT
     1//@ runFTLNoCJIT("--timeoutMultiplier=1.5")
    22
    33// If all goes well, this test module will terminate silently. If not, it will print
  • trunk/Source/JavaScriptCore/ChangeLog

    r208923 r208925  
     12016-11-19  Mark Lam  <mark.lam@apple.com>
     2
     3        Add --timeoutMultiplier option to allow some tests more time to run.
     4        https://bugs.webkit.org/show_bug.cgi?id=164951
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * jsc.cpp:
     9        (timeoutThreadMain):
     10        - Modified to factor in a timeout multiplier that can adjust the timeout duration.
     11        (startTimeoutThreadIfNeeded):
     12        - Moved the code that starts the timeout thread here from main() so that we can
     13        call it after command line args have been parsed instead.
     14        (main):
     15        - Deleted old timeout thread starting code.
     16        (CommandLine::parseArguments):
     17        - Added parsing of the --timeoutMultiplier option.
     18        (jscmain):
     19        - Start the timeout thread if needed after we've parsed the command line args.
     20
    1212016-11-19  Mark Lam  <mark.lam@apple.com>
    222
  • trunk/Source/JavaScriptCore/jsc.cpp

    r208782 r208925  
    25992599
    26002600static double s_desiredTimeout;
     2601static double s_timeoutMultiplier = 1.0;
    26012602
    26022603static NO_RETURN_DUE_TO_CRASH void timeoutThreadMain(void*)
    26032604{
    2604     auto timeout = std::chrono::microseconds(static_cast<std::chrono::microseconds::rep>(s_desiredTimeout * 1000000));
    2605     std::this_thread::sleep_for(timeout);
    2606    
    2607     dataLog("Timed out after ", s_desiredTimeout, " seconds!\n");
     2605    Seconds timeoutDuration(s_desiredTimeout * s_timeoutMultiplier);
     2606    sleep(timeoutDuration);
     2607    dataLog("Timed out after ", timeoutDuration, " seconds!\n");
    26082608    CRASH();
     2609}
     2610
     2611static void startTimeoutThreadIfNeeded()
     2612{
     2613    if (char* timeoutString = getenv("JSCTEST_timeout")) {
     2614        if (sscanf(timeoutString, "%lf", &s_desiredTimeout) != 1) {
     2615            dataLog("WARNING: timeout string is malformed, got ", timeoutString,
     2616                " but expected a number. Not using a timeout.\n");
     2617        } else
     2618            createThread(timeoutThreadMain, 0, "jsc Timeout Thread");
     2619    }
    26092620}
    26102621
     
    26502661    // have a chance to parse options.
    26512662    WTF::initializeThreading();
    2652 
    2653     if (char* timeoutString = getenv("JSCTEST_timeout")) {
    2654         if (sscanf(timeoutString, "%lf", &s_desiredTimeout) != 1) {
    2655             dataLog(
    2656                 "WARNING: timeout string is malformed, got ", timeoutString,
    2657                 " but expected a number. Not using a timeout.\n");
    2658         } else
    2659             createThread(timeoutThreadMain, 0, "jsc Timeout Thread");
    2660     }
    26612663
    26622664#if PLATFORM(IOS)
     
    30113013        }
    30123014
     3015        static const char* timeoutMultiplierOptStr = "--timeoutMultiplier=";
     3016        static const unsigned timeoutMultiplierOptStrLength = strlen(timeoutMultiplierOptStr);
     3017        if (!strncmp(arg, timeoutMultiplierOptStr, timeoutMultiplierOptStrLength)) {
     3018            const char* valueStr = &arg[timeoutMultiplierOptStrLength];
     3019            if (sscanf(valueStr, "%lf", &s_timeoutMultiplier) != 1)
     3020                dataLog("WARNING: --timeoutMultiplier=", valueStr, " is invalid. Expects a numeric ratio.\n");
     3021            continue;
     3022        }
     3023
    30133024        if (!strcmp(arg, "--test262-async")) {
    30143025            test262AsyncTest = true;
     
    31373148    WTF::initializeMainThread();
    31383149    JSC::initializeThreading();
     3150    startTimeoutThreadIfNeeded();
    31393151
    31403152    VM* vm = &VM::create(LargeHeap).leakRef();
Note: See TracChangeset for help on using the changeset viewer.