ExecuteScriptAsync fails to timeout on long-running script |
||
Issue description
Chrome Version: 61.0.3163.100
OS: Linux64
What steps will reproduce the problem?
(1) Call ExecuteScriptAsync with 'var arr = {}; arr.length = 2**53 - 1; Array.prototype.splice.call(arr, 0, 0, null);'
OR
(1) Change https://cs.chromium.org/chromium/src/chrome/test/chromedriver/js/execute_async_script_test.html?l=94&rcl=43dc91d8aca8d4620d2a2b4a857c744ff44c0a2b to use the above script instead of an empty script
(2) Open the test page, note the test hangs indefinitely.
Note: The given test script hangs Chrome when run from the console and is taken from Test262, https://github.com/tc39/test262/blob/master/test/built-ins/Array/prototype/splice/throws-if-integer-limit-exceeded.js
What is the expected result?
Timeout after the given timeout value.
What happens instead?
Test hangs forever
,
Sep 28 2017
The JavaScript code given in the repro is a synchronous script, not an async one, since it runs a large amount of code with scheduling any async activities. The timeout mechanism only works with async scripts. Also, due to the single-threaded nature of JavaScript, the async script must not block the CPU for a long time, but must schedule all its activities as short async operations.
Here is an example async script that runs infinite amount of work, the type that the timeout is intended to work with:
var i=0; function doWork(){i++; setTimeout(doWork,0);} doWork();
|
||
►
Sign in to add a comment |
||
Comment 1 by gmanikpure@chromium.org
, Sep 27 201732.2 KB
32.2 KB View Download