Changeset 250872 in webkit


Ignore:
Timestamp:
Oct 8, 2019 4:03:02 PM (5 years ago)
Author:
yurys@chromium.org
Message:

Web Inspector: inspector/layers/layers-for-node.html and inspector/timeline/line-column.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=202649

Reviewed by Devin Rousso.

Unflake a couple of inspector protocol tests. r250655 replaced Timer-based queue
with RunLoop-based one for inspector message dispatching. The tests apparently relied
on the timing of the message delivery and had been less flaky before. Updated the tests
to wait for explicit signals rather than relying on event timing.

  • inspector/layers/layers-for-node-expected.txt:
  • inspector/layers/layers-for-node.html: Updated the test to wait for the first

LayerTree.layerTreeDidChange event before requesting initial layer tree.

Also after adding a node wait for next RAF to avoid flakiness.

  • inspector/timeline/line-column-expected.txt:
  • inspector/timeline/line-column.html: There a style recalc event

which appears intermittently in the recorded profile making the test
flaky. To avoid that dump only events that are always present.

Location:
trunk/LayoutTests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r250866 r250872  
     12019-10-08  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Web Inspector: inspector/layers/layers-for-node.html and  inspector/timeline/line-column.html are flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=202649
     5
     6        Reviewed by Devin Rousso.
     7
     8        Unflake a couple of inspector protocol tests. r250655 replaced Timer-based queue
     9        with RunLoop-based one for inspector message dispatching. The tests apparently relied
     10        on the timing of the message delivery and had been less flaky before. Updated the tests
     11        to wait for explicit signals rather than relying on event timing.
     12
     13        * inspector/layers/layers-for-node-expected.txt:
     14        * inspector/layers/layers-for-node.html: Updated the test to wait for the first
     15        LayerTree.layerTreeDidChange event before requesting initial layer tree.
     16
     17        Also after adding a node wait for next RAF to avoid flakiness.
     18
     19        * inspector/timeline/line-column-expected.txt:
     20        * inspector/timeline/line-column.html: There a style recalc event
     21        which appears intermittently in the recorded profile making the test
     22        flaky. To avoid that dump only events that are always present.
     23
    1242019-10-08  Kate Cheney  <katherine_cheney@apple.com>
    225
  • trunk/LayoutTests/inspector/layers/layers-for-node-expected.txt

    r188142 r250872  
    127127PASS
    128128
     129=== Wait for requestAnimationFrame ===
     130
     131PASS
     132
    129133=== Get the modified layer tree ===
    130134
  • trunk/LayoutTests/inspector/layers/layers-for-node.html

    r210062 r250872  
    1010    element.id = "last-element";
    1111    document.body.appendChild(element);
     12    return new Promise(resolve => requestAnimationFrame(resolve));
    1213};
    1314
    1415function test()
    1516{
    16     var documentNode;
    17     var initialLayers;
    18     var eventsCount = 0;
    19 
    20     InspectorProtocol.eventHandler["LayerTree.layerTreeDidChange"] = function (messageObject) {
    21         eventsCount++;
    22     };
    23 
    24     enableLayerTreeAgent();
    25 
    26     function enableLayerTreeAgent(result)
    27     {
    28         step({
    29             name: "Enable the LayerTree agent",
    30             command: "LayerTree.enable",
    31             parameters: {},
    32             callback: getDocument
    33         });
    34     };
    35    
    36     function getDocument(result)
     17    let documentNode;
     18    let initialLayers;
     19
     20    step({
     21        name: "Enable the LayerTree agent",
     22        command: "LayerTree.enable",
     23        parameters: {},
     24        callback: () => {}
     25    });
     26
     27    InspectorProtocol.awaitEvent({event: "LayerTree.layerTreeDidChange"}).then(getDocument);
     28
     29    function getDocument()
    3730    {
    3831        step({
     
    6558            command: "Runtime.evaluate",
    6659            parameters: {"expression": "addCompositedLayer()"},
     60            callback: awaitRequestAnimationFrame
     61        });
     62    };
     63
     64    function awaitRequestAnimationFrame(result)
     65    {
     66        step({
     67            name: "Wait for requestAnimationFrame",
     68            command: "Runtime.awaitPromise",
     69            parameters: {"promiseObjectId": result.result.objectId},
    6770            callback: getModifiedLayerTree
    6871        });
     
    107110    function finishTest()
    108111    {
    109         if (!eventsCount)
    110             ProtocolTest.log("FAIL: Did not receive layerTreeDidChange events.");
    111         else
    112             ProtocolTest.log("\n=== Test complete, all expected conditions met ===");
    113 
     112        ProtocolTest.log("\n=== Test complete, all expected conditions met ===");
    114113        ProtocolTest.completeTest();
    115114    };
  • trunk/LayoutTests/inspector/timeline/line-column-expected.txt

    r249445 r250872  
    1111  "data": {},
    1212  "children": [
    13     {
    14       "startTime": "<filtered>",
    15       "stackTrace": [
    16         {
    17           "functionName": "click",
    18           "url": "[native code]",
    19           "scriptId": "<filtered>",
    20           "lineNumber": 0,
    21           "columnNumber": 0
    22         },
    23         {
    24           "functionName": "willCallFunctionTest",
    25           "url": "timeline/line-column.html",
    26           "scriptId": "<filtered>",
    27           "lineNumber": 26,
    28           "columnNumber": 44
    29         },
    30         {
    31           "functionName": "global code",
    32           "url": "",
    33           "scriptId": "<filtered>",
    34           "lineNumber": 1,
    35           "columnNumber": 21
    36         },
    37         {
    38           "functionName": "evaluateWithScopeExtension",
    39           "url": "[native code]",
    40           "scriptId": "<filtered>",
    41           "lineNumber": 0,
    42           "columnNumber": 0
    43         },
    44         {
    45           "functionName": "",
    46           "url": "",
    47           "scriptId": "<filtered>",
    48           "lineNumber": 140,
    49           "columnNumber": 97
    50         }
    51       ],
    52       "data": {},
    53       "frameId": "<filtered>",
    54       "type": "ScheduleStyleRecalculation"
    55     },
    5613    {
    5714      "startTime": "<filtered>",
  • trunk/LayoutTests/inspector/timeline/line-column.html

    r248943 r250872  
    4141    InspectorProtocol.sendCommand("Timeline.enable");
    4242
     43    // To avoid flakiness print only events that we always expect.
     44    const eventWhitelist = new Set(["RenderingFrame", "ConsoleProfile", "EventDispatch", "FunctionCall"]);
    4345    function replacer(key, value) {
     46        if (key === "children" && this.startTime)
     47            return value.filter(e => eventWhitelist.has(e.type));
    4448        if (key === "startTime" || key === "endTime" || key === "scriptId" || key === "frameId")
    4549            return "<filtered>";
Note: See TracChangeset for help on using the changeset viewer.