Title: [275583] trunk
Revision
275583
Author
[email protected]
Date
2021-04-06 18:28:54 -0700 (Tue, 06 Apr 2021)

Log Message

[ Catalina WK2 Release ] http/tests/IndexedDB/storage-limit-1.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=213292
<rdar://problem/64447734>

Reviewed by Geoffrey Garen.

Test http/tests/IndexedDB/collect-IDB-objects.https.html, which runs right before
http/tests/IndexedDB/storage-limit-1.https.html, will delete databases after test completetion. During deletion,
we create a new database if it does not exist, extract database version from it, and then delete database files.
This creation can happen during storage-limit-1.https.html run and interrupt testing for quota. To fix the
flakiness and make the deletion more efficient, let's not create a new database during deletion if database
does not exist.

Source/WebCore:

* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::databaseVersion):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseVersion):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):

LayoutTests:

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (275582 => 275583)


--- trunk/LayoutTests/ChangeLog	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/LayoutTests/ChangeLog	2021-04-07 01:28:54 UTC (rev 275583)
@@ -1,3 +1,21 @@
+2021-04-06  Sihui Liu  <[email protected]>
+
+        [ Catalina WK2 Release ] http/tests/IndexedDB/storage-limit-1.https.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=213292
+        <rdar://problem/64447734>
+
+        Reviewed by Geoffrey Garen.
+
+        Test http/tests/IndexedDB/collect-IDB-objects.https.html, which runs right before 
+        http/tests/IndexedDB/storage-limit-1.https.html, will delete databases after test completetion. During deletion, 
+        we create a new database if it does not exist, extract database version from it, and then delete database files.
+        This creation can happen during storage-limit-1.https.html run and interrupt testing for quota. To fix the 
+        flakiness and make the deletion more efficient, let's not create a new database during deletion if database
+        does not exist.
+
+        * platform/mac-wk2/TestExpectations:
+        * platform/mac/TestExpectations:
+
 2021-04-06  Robert Jenner  <[email protected]>
 
         [ macOS wk2 ] webrtc/libwebrtc/release-while-creating-offer.html is a flakey text failure

Modified: trunk/LayoutTests/platform/mac/TestExpectations (275582 => 275583)


--- trunk/LayoutTests/platform/mac/TestExpectations	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2021-04-07 01:28:54 UTC (rev 275583)
@@ -1847,9 +1847,6 @@
 imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-implicit.html [ Pass Failure ]
 imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-without-codecs-parameter.html [ Pass Failure ]
 
-# <rdar://problem/56545293> REGRESSION (r250936?): http/tests/IndexedDB/storage-limit-1.https.html is a Flaky Failure
-[ Catalina Release ] http/tests/IndexedDB/storage-limit-1.https.html [ Pass Failure ]
-
 # <rdar://problem/60376665> [ macOS ] svg/custom/glyph-selection-arabic-forms.svg is failing since around r252706
 [ Mojave ] svg/custom/glyph-selection-arabic-forms.svg [ Failure ]
 

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (275582 => 275583)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-04-07 01:28:54 UTC (rev 275583)
@@ -988,8 +988,6 @@
 
 webkit.org/b/213212 [ Mojave Release ] webgl/2.0.0/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-half_float.html [ Pass Failure ]
 
-webkit.org/b/213292 [ Catalina Release ] http/tests/IndexedDB/storage-limit-1.https.html [ Pass Failure ]
-
 webkit.org/b/213461 fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html [ Pass Failure ]
 
 webkit.org/b/213621 imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getContributingSources.https.html [ Pass Failure ]
@@ -1085,9 +1083,6 @@
 #  <rdar://problem/64816527> swipe/pushState-cached-back-swipe.html is a flaky failure
 [ Catalina ] swipe/pushState-cached-back-swipe.html [ Pass Failure ]
 
-# <rdar://problem/63275213> REGRESSION: http/tests/IndexedDB/storage-limit-1.https.html is a flaky failure
-[ BigSur+ Release ] http/tests/IndexedDB/storage-limit-1.https.html [ Pass Failure ]
-
 # <rdar://problem/63554249> [20A279] DQ bots are seeing http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy.html and http/tests/cache/disk-cache/disk-cache-validation-no-body.html are timing out
 webkit.org/b/179796 http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy.html [ Pass Failure Timeout ]
 [ BigSur+ Release ] http/tests/cache/disk-cache/disk-cache-validation-no-body.html [ Pass Timeout ]

Modified: trunk/Source/WebCore/ChangeLog (275582 => 275583)


--- trunk/Source/WebCore/ChangeLog	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/Source/WebCore/ChangeLog	2021-04-07 01:28:54 UTC (rev 275583)
@@ -1,3 +1,28 @@
+2021-04-06  Sihui Liu  <[email protected]>
+
+        [ Catalina WK2 Release ] http/tests/IndexedDB/storage-limit-1.https.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=213292
+        <rdar://problem/64447734>
+
+        Reviewed by Geoffrey Garen.
+
+        Test http/tests/IndexedDB/collect-IDB-objects.https.html, which runs right before 
+        http/tests/IndexedDB/storage-limit-1.https.html, will delete databases after test completetion. During deletion, 
+        we create a new database if it does not exist, extract database version from it, and then delete database files.
+        This creation can happen during storage-limit-1.https.html run and interrupt testing for quota. To fix the 
+        flakiness and make the deletion more efficient, let's not create a new database during deletion if database
+        does not exist.
+
+        * Modules/indexeddb/server/IDBBackingStore.h:
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::databaseVersion):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+        (WebCore::IDBServer::SQLiteIDBBackingStore::databaseVersion):
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
+
 2021-04-06  Eric Carlson  <[email protected]>
 
         REGRESSION (r275538): [ macOS ] TestWebKitAPI.WebKitLegacy.MediaPlaybackSleepAssertion and TestWebKitAPI.SleepDisabler.Pause consistently failing

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (275582 => 275583)


--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h	2021-04-07 01:28:54 UTC (rev 275583)
@@ -62,6 +62,7 @@
     virtual ~IDBBackingStore() { RELEASE_ASSERT(!isMainThread()); }
 
     virtual IDBError getOrEstablishDatabaseInfo(IDBDatabaseInfo&) = 0;
+    virtual uint64_t databaseVersion() = 0;
 
     virtual IDBError beginTransaction(const IDBTransactionInfo&) = 0;
     virtual IDBError abortTransaction(const IDBResourceIdentifier& transactionIdentifier) = 0;

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (275582 => 275583)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp	2021-04-07 01:28:54 UTC (rev 275583)
@@ -63,6 +63,11 @@
     return IDBError { };
 }
 
+uint64_t MemoryIDBBackingStore::databaseVersion()
+{
+    return m_databaseInfo ? m_databaseInfo->version() : 0;
+}
+
 void MemoryIDBBackingStore::setDatabaseInfo(const IDBDatabaseInfo& info)
 {
     // It is not valid to directly set database info on a backing store that hasn't already set its own database info.

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (275582 => 275583)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h	2021-04-07 01:28:54 UTC (rev 275583)
@@ -46,6 +46,7 @@
     ~MemoryIDBBackingStore();
 
     IDBError getOrEstablishDatabaseInfo(IDBDatabaseInfo&) final;
+    uint64_t databaseVersion() final;
     void setDatabaseInfo(const IDBDatabaseInfo&);
 
     void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&);

Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (275582 => 275583)


--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp	2021-04-07 01:28:54 UTC (rev 275583)
@@ -1265,6 +1265,19 @@
     return IDBError { };
 }
 
+uint64_t SQLiteIDBBackingStore::databaseVersion()
+{
+    if (m_databaseInfo)
+        return m_databaseInfo->version();
+
+    String dbFilename = fullDatabasePath();
+    if (!FileSystem::fileExists(dbFilename))
+        return 0;
+
+    auto databaseNameAndVersion = databaseNameAndVersionFromFile(dbFilename);
+    return databaseNameAndVersion ? databaseNameAndVersion->version : 0;
+}
+
 uint64_t SQLiteIDBBackingStore::databasesSizeForDirectory(const String& directory, bool shouldPrintUsageDetail)
 {
     uint64_t diskUsage = 0;

Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h (275582 => 275583)


--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h	2021-04-07 01:28:54 UTC (rev 275583)
@@ -57,6 +57,7 @@
     ~SQLiteIDBBackingStore() final;
 
     IDBError getOrEstablishDatabaseInfo(IDBDatabaseInfo&) final;
+    uint64_t databaseVersion() final;
 
     IDBError beginTransaction(const IDBTransactionInfo&) final;
     IDBError abortTransaction(const IDBResourceIdentifier& transactionIdentifier) final;

Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (275582 => 275583)


--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2021-04-07 01:19:15 UTC (rev 275582)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2021-04-07 01:28:54 UTC (rev 275583)
@@ -291,24 +291,10 @@
 {
     ASSERT(!isMainThread());
     LOG(IndexedDB, "UniqueIDBDatabase::deleteBackingStore");
-
-    uint64_t deletedVersion = 0;
-
-    if (m_backingStore) {
-        m_backingStore->deleteBackingStore();
-        m_backingStore = nullptr;
-    } else {
-        auto backingStore = m_server.createBackingStore(m_identifier);
-
-        IDBDatabaseInfo databaseInfo;
-        auto error = backingStore->getOrEstablishDatabaseInfo(databaseInfo);
-        if (!error.isNull())
-            LOG_ERROR("Error getting database info from database %s that we are trying to delete", m_identifier.loggingString().utf8().data());
-
-        deletedVersion = databaseInfo.version();
-        backingStore->deleteBackingStore();
-    }
-
+    
+    auto backingStore = m_backingStore ? std::exchange(m_backingStore, nullptr) : m_server.createBackingStore(m_identifier);
+    uint64_t deletedVersion = backingStore->databaseVersion();
+    backingStore->deleteBackingStore();
     didDeleteBackingStore(deletedVersion);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to