Title: [264391] trunk
Revision
264391
Author
[email protected]
Date
2020-07-15 03:18:40 -0700 (Wed, 15 Jul 2020)

Log Message

[JSC] Introduce JSCTEST_hardTimeout
https://bugs.webkit.org/show_bug.cgi?id=214343

Reviewed by Mark Lam.

Source/_javascript_Core:

JSC Debug tests are failing consistently these days, https://build.webkit.org/builders/Apple-Catalina-Debug-JSC-Tests/.
My guess is that some tests get stuck inside JSC even if timeout occurs. Let's consider the following case.

    1. The test is having `JSC_useConcurrentJIT=0`.
    2. The test is building super heavy FTL code in the main thread.
    3. The timeout thread notifies the VM about the timeout.
    4. But VM does not stop since it is running super heavy FTL compilation.
    5. After 1200 seconds, buildbot terminates the entire test.

In the above case, JSC gets stuck, and eventually buildbot terminates.
In this patch, we introduce JSCTEST_hardTimeout. After soft-timeout (usual timeout) happens, we wait another JSCTEST_hardTimeout seconds.
And if the JSC shell is not finished, we forcefully terminates the JSC shell via exit(EXIT_FAILURE), to avoid entire JSC test termination
in buildbot.

We pick 300 seconds. This means, after soft-timeout occurs, we wait for 5 mins, and if the JSC shell is still active, kill it. 5 mins sounds
reasonable amount of time. And this should fit within buildbot's hard timeout (1200 seconds).

* jsc.cpp:
(startTimeoutTimer):

Tools:

* Scripts/run-_javascript_core-tests:
* Scripts/run-jsc-stress-tests:
* Scripts/webkitruby/jsc-stress-test-writer-default.rb:
* Scripts/webkitruby/jsc-stress-test-writer-ruby.rb:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (264390 => 264391)


--- trunk/Source/_javascript_Core/ChangeLog	2020-07-15 08:52:32 UTC (rev 264390)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-07-15 10:18:40 UTC (rev 264391)
@@ -1,3 +1,30 @@
+2020-07-15  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Introduce JSCTEST_hardTimeout
+        https://bugs.webkit.org/show_bug.cgi?id=214343
+
+        Reviewed by Mark Lam.
+
+        JSC Debug tests are failing consistently these days, https://build.webkit.org/builders/Apple-Catalina-Debug-JSC-Tests/.
+        My guess is that some tests get stuck inside JSC even if timeout occurs. Let's consider the following case.
+
+            1. The test is having `JSC_useConcurrentJIT=0`.
+            2. The test is building super heavy FTL code in the main thread.
+            3. The timeout thread notifies the VM about the timeout.
+            4. But VM does not stop since it is running super heavy FTL compilation.
+            5. After 1200 seconds, buildbot terminates the entire test.
+
+        In the above case, JSC gets stuck, and eventually buildbot terminates.
+        In this patch, we introduce JSCTEST_hardTimeout. After soft-timeout (usual timeout) happens, we wait another JSCTEST_hardTimeout seconds.
+        And if the JSC shell is not finished, we forcefully terminates the JSC shell via exit(EXIT_FAILURE), to avoid entire JSC test termination
+        in buildbot.
+
+        We pick 300 seconds. This means, after soft-timeout occurs, we wait for 5 mins, and if the JSC shell is still active, kill it. 5 mins sounds
+        reasonable amount of time. And this should fit within buildbot's hard timeout (1200 seconds).
+
+        * jsc.cpp:
+        (startTimeoutTimer):
+
 2020-07-14  Saam Barati  <[email protected]>
 
         We must hold the CodeBlock lock when calling StructureStubInfo::reset

Modified: trunk/Source/_javascript_Core/jsc.cpp (264390 => 264391)


--- trunk/Source/_javascript_Core/jsc.cpp	2020-07-15 08:52:32 UTC (rev 264390)
+++ trunk/Source/_javascript_Core/jsc.cpp	2020-07-15 10:18:40 UTC (rev 264391)
@@ -2520,6 +2520,18 @@
             vm.notifyNeedShellTimeoutCheck();
             return VMInspector::FunctorStatus::Done;
         });
+
+        if (const char* timeoutString = getenv("JSCTEST_hardTimeout")) {
+            double hardTimeoutInDouble = 0;
+            if (sscanf(timeoutString, "%lf", &hardTimeoutInDouble) != 1)
+                dataLog("WARNING: hardTimeout string is malformed, got ", timeoutString, " but expected a number. Not using a timeout.\n");
+            else {
+                Seconds hardTimeout { hardTimeoutInDouble };
+                sleep(hardTimeout);
+                dataLogLn("HARD TIMEOUT after ", hardTimeout);
+                exit(EXIT_FAILURE);
+            }
+        }
     });
 }
 

Modified: trunk/Tools/ChangeLog (264390 => 264391)


--- trunk/Tools/ChangeLog	2020-07-15 08:52:32 UTC (rev 264390)
+++ trunk/Tools/ChangeLog	2020-07-15 10:18:40 UTC (rev 264391)
@@ -1,3 +1,15 @@
+2020-07-15  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Introduce JSCTEST_hardTimeout
+        https://bugs.webkit.org/show_bug.cgi?id=214343
+
+        Reviewed by Mark Lam.
+
+        * Scripts/run-_javascript_core-tests:
+        * Scripts/run-jsc-stress-tests:
+        * Scripts/webkitruby/jsc-stress-test-writer-default.rb:
+        * Scripts/webkitruby/jsc-stress-test-writer-ruby.rb:
+
 2020-07-15  Carlos Garcia Campos  <[email protected]>
 
         [GTK] API test /webkit/WebKitWebInspectorServer/test-page-list is flaky

Modified: trunk/Tools/Scripts/run-_javascript_core-tests (264390 => 264391)


--- trunk/Tools/Scripts/run-_javascript_core-tests	2020-07-15 08:52:32 UTC (rev 264390)
+++ trunk/Tools/Scripts/run-_javascript_core-tests	2020-07-15 10:18:40 UTC (rev 264391)
@@ -570,6 +570,7 @@
 my $productDir = jscProductDir();
 $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
 $ENV{JSCTEST_timeout} = 120 unless $ENV{JSCTEST_timeout}; # Set a 120 second timeout on all jsc tests (if environment variable not defined already).
+$ENV{JSCTEST_hardTimeout} = 300 unless $ENV{JSCTEST_hardTimeout}; # Set a 300 second hard timeout on all jsc tests (if environment variable not defined already). If the test does not finish after 300 seconds from soft-timeout, we terminate the shell.
 $ENV{TZ}="US/Pacific"; # Some tests fail if the time zone is not set to US/Pacific (<https://webkit.org/b/136363>)
 setPathForRunningWebKitApp(\%ENV) if isCygwin();
 

Modified: trunk/Tools/Scripts/run-jsc-stress-tests (264390 => 264391)


--- trunk/Tools/Scripts/run-jsc-stress-tests	2020-07-15 08:52:32 UTC (rev 264390)
+++ trunk/Tools/Scripts/run-jsc-stress-tests	2020-07-15 10:18:40 UTC (rev 264391)
@@ -2105,6 +2105,7 @@
         remoteScript += "export DYLD_FRAMEWORK_PATH=\\\"\\$(cd #{$testingFrameworkPath.dirname}; pwd)\\\" && "
         remoteScript += "export LD_LIBRARY_PATH=#{remoteHost.remoteDirectory}/#{$outputDir.basename}/#{$jscPath.dirname} && "
         remoteScript += "export JSCTEST_timeout=#{Shellwords.shellescape(ENV['JSCTEST_timeout'])} && "
+        remoteScript += "export JSCTEST_hardTimeout=#{Shellwords.shellescape(ENV['JSCTEST_hardTimeout'])} && "
         remoteScript += "export JSCTEST_memoryLimit=#{Shellwords.shellescape(ENV['JSCTEST_memoryLimit'])} && "
         remoteScript += "export TZ=#{Shellwords.shellescape(ENV['TZ'])} && "
         $envVars.each { |var| remoteScript += "export " << var << "\n" }
@@ -2238,6 +2239,8 @@
     ENV["JSCTEST_timeout"] = (ENV["JSCTEST_timeout"].to_i.to_f * Math.sqrt($numChildProcesses)).to_i.to_s
 end
 
+# We do not adjust hardTimeout. If we are not producing any results during 1200 seconds, buildbot terminates the tests. So we should terminate hung tests.
+
 if !ENV["JSCTEST_memoryLimit"] && $memoryLimited
     ENV["JSCTEST_memoryLimit"] = (600 * 1024 * 1024).to_s
 end

Modified: trunk/Tools/Scripts/webkitruby/jsc-stress-test-writer-default.rb (264390 => 264391)


--- trunk/Tools/Scripts/webkitruby/jsc-stress-test-writer-default.rb	2020-07-15 08:52:32 UTC (rev 264390)
+++ trunk/Tools/Scripts/webkitruby/jsc-stress-test-writer-default.rb	2020-07-15 10:18:40 UTC (rev 264391)
@@ -256,6 +256,7 @@
 
         script += "export DYLD_FRAMEWORK_PATH=$(cd #{$testingFrameworkPath.dirname}; pwd)\n"
         script += "export JSCTEST_timeout=#{Shellwords.shellescape(ENV['JSCTEST_timeout'])}\n"
+        script += "export JSCTEST_hardTimeout=#{Shellwords.shellescape(ENV['JSCTEST_hardTimeout'])}\n"
         script += "export JSCTEST_memoryLimit=#{Shellwords.shellescape(ENV['JSCTEST_memoryLimit'])}\n"
         $envVars.each { |var| script += "export " << var << "\n" }
         script += "#{shellCommand} || exit 1"

Modified: trunk/Tools/Scripts/webkitruby/jsc-stress-test-writer-ruby.rb (264390 => 264391)


--- trunk/Tools/Scripts/webkitruby/jsc-stress-test-writer-ruby.rb	2020-07-15 08:52:32 UTC (rev 264390)
+++ trunk/Tools/Scripts/webkitruby/jsc-stress-test-writer-ruby.rb	2020-07-15 10:18:40 UTC (rev 264391)
@@ -313,6 +313,7 @@
         script += "/.runner\") do\n"
         script += "            ENV[\"DYLD_FRAMEWORK_PATH\"] = \"#{$testingFrameworkPath.dirname}\"\n"
         script += "            ENV[\"JSCTEST_timeout\"] = \"#{ENV['JSCTEST_timeout']}\"\n"
+        script += "            ENV[\"JSCTEST_hardTimeout\"] = \"#{ENV['JSCTEST_hardTimeout']}\"\n"
         script += "            ENV[\"JSCTEST_memoryLimit\"] = \"#{ENV['JSCTEST_memoryLimit']}\"\n"
 
         script += "            #{shellCommand}"
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to