Increase the timeout for clearing indexeddbs
Chrome seems to take ages (like, 1500ms regularly) to clear out the indexeddbs, and that's causing test timeouts. Bump the timeout to hack around it. Also: clear both dbs in parallel (can't hurt, right?) and improve diagnostics on the process.
This commit is contained in:
@@ -34,7 +34,8 @@ export function deleteIndexedDB(dbName) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`${Date.now()}: Removing indexeddb instance: ${dbName}`);
|
||||
const startTime = Date.now();
|
||||
console.log(`${startTime}: Removing indexeddb instance: ${dbName}`);
|
||||
const req = window.indexedDB.deleteDatabase(dbName);
|
||||
|
||||
req.onblocked = () => {
|
||||
@@ -48,7 +49,8 @@ export function deleteIndexedDB(dbName) {
|
||||
};
|
||||
|
||||
req.onsuccess = () => {
|
||||
console.log(`${Date.now()}: Removed indexeddb instance: ${dbName}`);
|
||||
const now = Date.now();
|
||||
console.log(`${now}: Removed indexeddb instance: ${dbName} in ${now-startTime} ms`);
|
||||
resolve();
|
||||
};
|
||||
}).catch((e) => {
|
||||
|
||||
Reference in New Issue
Block a user