Changeset 234061 in webkit


Ignore:
Timestamp:
Jul 20, 2018 12:34:09 PM (6 years ago)
Author:
Chris Dumez
Message:

REGRESSION(PSON?): [ WK2 ] http/tests/workers/service/client-*-page-cache.html LayoutTests are flaky
https://bugs.webkit.org/show_bug.cgi?id=183705

Reviewed by Youenn Fablet.

At the beginning of the tests, wait for the client count to reach the expected value instead of
expecting it to be the right value right away. Clients unregister themselves asynchronously so
it is flaky otherwise.

  • http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html:
  • http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html:
  • http/tests/workers/service/serviceworkerclients-matchAll-worker.js:

(async.doTestAfterMessage):

Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r234056 r234061  
     12018-07-20  Chris Dumez  <cdumez@apple.com>
     2
     3        REGRESSION(PSON?): [ WK2 ] http/tests/workers/service/client-*-page-cache.html LayoutTests are flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=183705
     5
     6        Reviewed by Youenn Fablet.
     7
     8        At the beginning of the tests, wait for the client count to reach the expected value instead of
     9        expecting it to be the right value right away. Clients unregister themselves asynchronously so
     10        it is flaky otherwise.
     11
     12        * http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html:
     13        * http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html:
     14        * http/tests/workers/service/serviceworkerclients-matchAll-worker.js:
     15        (async.doTestAfterMessage):
     16
    1172018-07-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>
    218
  • trunk/LayoutTests/http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html

    r226677 r234061  
    1212}
    1313
     14let tries = 0;
     15
    1416navigator.serviceWorker.addEventListener("message", function(event) {
    1517  if (step == "BothClientsInitiallyActive") {
    1618    if (event.data != 2) {
    17       log("FAIL: Wrong initial number of clients: " + event.data);
    18       finishSWTest();
     19      if (++tries > 20) {
     20          log("FAIL: Wrong initial number of clients: " + event.data);
     21          finishSWTest();
     22          return;
     23      }
     24      worker.postMessage("getClientCount");
    1925      return;
    2026    }
  • trunk/LayoutTests/http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html

    r226677 r234061  
    1212}
    1313
     14let tries = 0;
     15
    1416navigator.serviceWorker.addEventListener("message", function(event) {
    1517  if (step == "BothClientsInitiallyActive") {
    1618    if (event.data != 2) {
    17       log("FAIL: Wrong initial number of clients: " + event.data);
    18       finishSWTest();
     19      if (++tries > 20) {
     20          log("FAIL: Wrong initial number of clients: " + event.data);
     21          finishSWTest();
     22          return;
     23      }
     24      worker.postMessage("getClientCount");
    1925      return;
    2026    }
  • trunk/LayoutTests/http/tests/workers/service/serviceworkerclients-matchAll-worker.js

    r225452 r234061  
    1 var matchAllPromise1 = self.clients.matchAll().then((clients) => {
    2     return clients.length === 0 ? "PASS" : "FAIL: expected no matched client, got " + clients.length;
    3 }, (e) => {
    4     return "FAIL: matchAll 1 rejected with " + e;
    5 });
    6 
     1function matchAllPromise1()
     2{
     3    return self.clients.matchAll().then((clients) => {
     4        return clients.length === 0 ? "PASS" : "FAIL: expected no matched client, got " + clients.length;
     5    }, (e) => {
     6        return "FAIL: matchAll 1 rejected with " + e;
     7    });
     8}
    79
    810var matchedClients;
     
    2224        }
    2325
    24         var result = await matchAllPromise1;
     26        let tries = 0;
     27        do {
     28            if (tries)
     29                await waitFor(50);
     30            result = await matchAllPromise1();
     31        } while (result !== "PASS" && ++tries <= 20);
     32
    2533        if (result !== "PASS") {
    2634            event.source.postMessage(result);
Note: See TracChangeset for help on using the changeset viewer.