Changeset 246453 in webkit


Ignore:
Timestamp:
Jun 14, 2019 7:23:16 PM (5 years ago)
Author:
wilander@apple.com
Message:

Repeatedly check for IDB removal to address flakiness in http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html
https://bugs.webkit.org/show_bug.cgi?id=198185
<rdar://problem/51074251>

Unreviewed test gardening.

There's an asynchronosity in the removal of IDB entries so this test case
needs to check repeatedly until the removal has happened.

  • http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html:
  • platform/ios-simulator-wk2/TestExpectations:

Removed skip.

Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246450 r246453  
     12019-06-14  John Wilander  <wilander@apple.com>
     2
     3        Repeatedly check for IDB removal to address flakiness in http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html
     4        https://bugs.webkit.org/show_bug.cgi?id=198185
     5        <rdar://problem/51074251>
     6
     7        Unreviewed test gardening.
     8
     9        There's an asynchronosity in the removal of IDB entries so this test case
     10        needs to check repeatedly until the removal has happened.
     11
     12        * http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html:
     13        * platform/ios-simulator-wk2/TestExpectations:
     14            Removed skip.
     15
    1162019-06-14  Daniel Bates  <dabates@apple.com>
    217
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html

    r243632 r246453  
    7676    }
    7777
     78    const maxIntervals = 20;
     79
     80    let intervalCounterIDB;
     81    let checkIDBCallback;
     82    let checkIDBIntervalID;
     83    let semaphoreIDBCheck = false;
    7884    function checkIDBDataStoreExists(isAfterDeletion, callback) {
    79         let request = indexedDB.open(dbName);
    80         request.onerror = function() {
    81             addOutput("Couldn't open indexedDB.");
    82             finishTest();
    83         };
    84         request.onupgradeneeded = function () {
    85             addOutput((isAfterDeletion ? "After" : "Before") + " deletion: IDB entry does not exist.");
    86             callback();
    87         };
    88         request.onsuccess = function() {
    89             addOutput((isAfterDeletion ? "After" : "Before") + " deletion: IDB entry does exist.");
    90             callback();
    91         };
    92     }
    93 
    94     const maxIntervals = 20;
    95     let intervalCounter;
     85        let request;
     86        intervalCounterIDB = 0;
     87        checkIDBCallback = callback;
     88        if (!isAfterDeletion) {
     89            // Check until there is a IDB.
     90            checkIDBIntervalID = setInterval(function() {
     91                if (semaphoreIDBCheck)
     92                    return;
     93                semaphoreIDBCheck = true;
     94
     95                if (++intervalCounterIDB >= maxIntervals) {
     96                    clearInterval(checkIDBIntervalID);
     97                    addOutput("Before deletion: IDB entry does not exist.");
     98                    semaphoreIDBCheck = false;
     99                    checkIDBCallback();
     100                } else {
     101                    request = indexedDB.open(dbName);
     102                    request.onerror = function () {
     103                        clearInterval(checkIDBIntervalID);
     104                        addOutput("Couldn't open indexedDB.");
     105                        semaphoreIDBCheck = false;
     106                        finishTest();
     107                    };
     108                    request.onupgradeneeded = function () {
     109                        // Let the next interval check again.
     110                        semaphoreIDBCheck = false;
     111                    };
     112                    request.onsuccess = function () {
     113                        clearInterval(checkIDBIntervalID);
     114                        addOutput("Before deletion: IDB entry does exist.");
     115                        semaphoreIDBCheck = false;
     116                        checkIDBCallback();
     117                    };
     118                }
     119            }, 200);
     120        } else {
     121            // Check until there is no IDB.
     122            checkIDBIntervalID = setInterval(function () {
     123                if (semaphoreIDBCheck)
     124                    return;
     125                semaphoreIDBCheck = true;
     126
     127                if (++intervalCounterIDB >= maxIntervals) {
     128                    clearInterval(checkIDBIntervalID);
     129                    addOutput("Before deletion: IDB entry does not exist.");
     130                    semaphoreIDBCheck = false;
     131                    checkIDBCallback();
     132                } else {
     133                    request = indexedDB.open(dbName);
     134                    request.onerror = function () {
     135                        clearInterval(checkIDBIntervalID);
     136                        addOutput("Couldn't open indexedDB.");
     137                        semaphoreIDBCheck = false;
     138                        finishTest();
     139                    };
     140                    request.onupgradeneeded = function () {
     141                        clearInterval(checkIDBIntervalID);
     142                        addOutput("After deletion: IDB entry does not exist.");
     143                        semaphoreIDBCheck = false;
     144                        checkIDBCallback();
     145                    };
     146                    request.onsuccess = function () {
     147                        // Let the next interval check again.
     148                        semaphoreIDBCheck = false;
     149                    };
     150                }
     151            }, 200);
     152        }
     153    }
     154
     155    let intervalCounterLocalStorage;
    96156    let checkLocalStorageCallback;
    97157    let checkLocalStorageIntervalID;
     
    99159    const localStorageValue = "value";
    100160    function checkLocalStorageExists(isAfterDeletion, callback) {
    101         intervalCounter = 0;
     161        intervalCounterLocalStorage = 0;
    102162        checkLocalStorageCallback = callback;
    103163        if (!isAfterDeletion) {
    104164            // Check until there is LocalStorage.
    105165            checkLocalStorageIntervalID = setInterval(function() {
    106                 if (++intervalCounter === maxIntervals) {
     166                if (++intervalCounterLocalStorage >= maxIntervals) {
    107167                    clearInterval(checkLocalStorageIntervalID);
    108168                    checkLocalStorageCallback();
     
    117177            // Check until there is no LocalStorage.
    118178            checkLocalStorageIntervalID = setInterval(function() {
    119                 if (++intervalCounter === maxIntervals) {
     179                if (++intervalCounterLocalStorage >= maxIntervals) {
    120180                    clearInterval(checkLocalStorageIntervalID);
    121181                    checkLocalStorageCallback();
  • trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations

    r246318 r246453  
    9090
    9191imported/w3c/web-platform-tests/IndexedDB/keypath-special-identifiers.htm [ Slow ]
    92 
    93 webkit.org/b/198185 http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html [ Skip ]
Note: See TracChangeset for help on using the changeset viewer.