@@ -381,31 +386,15 @@ flakySuite('SQLite Storage Library', function () {
...
@@ -381,31 +386,15 @@ flakySuite('SQLite Storage Library', function () {
}
}
test('basics',async()=>{
test('basics',async()=>{
conststorageDir=uniqueStorageDir();
awaitmkdirp(storageDir);
awaittestDBBasics(join(storageDir,'storage.db'));
awaittestDBBasics(join(storageDir,'storage.db'));
awaitrimraf(storageDir);
});
});
test('basics (open multiple times)',async()=>{
test('basics (open multiple times)',async()=>{
conststorageDir=uniqueStorageDir();
awaitmkdirp(storageDir);
awaittestDBBasics(join(storageDir,'storage.db'));
awaittestDBBasics(join(storageDir,'storage.db'));
awaittestDBBasics(join(storageDir,'storage.db'));
awaittestDBBasics(join(storageDir,'storage.db'));
awaitrimraf(storageDir);
});
});
test('basics (corrupt DB falls back to empty DB)',async()=>{
test('basics (corrupt DB falls back to empty DB)',async()=>{
conststorageDir=uniqueStorageDir();
awaitmkdirp(storageDir);
constcorruptDBPath=join(storageDir,'broken.db');
constcorruptDBPath=join(storageDir,'broken.db');
awaitwriteFile(corruptDBPath,'This is a broken DB');
awaitwriteFile(corruptDBPath,'This is a broken DB');
...
@@ -415,15 +404,9 @@ flakySuite('SQLite Storage Library', function () {
...
@@ -415,15 +404,9 @@ flakySuite('SQLite Storage Library', function () {
});
});
ok(expectedError);
ok(expectedError);
awaitrimraf(storageDir);
});
});
test('basics (corrupt DB restores from previous backup)',async()=>{
test('basics (corrupt DB restores from previous backup)',async()=>{
conststorageDir=uniqueStorageDir();
awaitmkdirp(storageDir);
conststoragePath=join(storageDir,'storage.db');
conststoragePath=join(storageDir,'storage.db');
letstorage=newSQLiteStorageDatabase(storagePath);
letstorage=newSQLiteStorageDatabase(storagePath);
...
@@ -453,15 +436,9 @@ flakySuite('SQLite Storage Library', function () {
...
@@ -453,15 +436,9 @@ flakySuite('SQLite Storage Library', function () {
});
});
equal(recoveryCalled,false);
equal(recoveryCalled,false);
awaitrimraf(storageDir);
});
});
test('basics (corrupt DB falls back to empty DB if backup is corrupt)',async()=>{
test('basics (corrupt DB falls back to empty DB if backup is corrupt)',async()=>{
conststorageDir=uniqueStorageDir();
awaitmkdirp(storageDir);
conststoragePath=join(storageDir,'storage.db');
conststoragePath=join(storageDir,'storage.db');
letstorage=newSQLiteStorageDatabase(storagePath);
letstorage=newSQLiteStorageDatabase(storagePath);
...
@@ -482,21 +459,9 @@ flakySuite('SQLite Storage Library', function () {
...
@@ -482,21 +459,9 @@ flakySuite('SQLite Storage Library', function () {
equal(storedItems.size,0);
equal(storedItems.size,0);
awaittestDBBasics(storagePath);
awaittestDBBasics(storagePath);
awaitrimraf(storageDir);
});
});
test('basics (DB that becomes corrupt during runtime stores all state from cache on close)',async()=>{
(isWindows?test.skip/* Windows will fail to write to open DB due to locking */:test)('basics (DB that becomes corrupt during runtime stores all state from cache on close)',async()=>{
if(isWindows){
awaitPromise.resolve();// Windows will fail to write to open DB due to locking
return;
}
conststorageDir=uniqueStorageDir();
awaitmkdirp(storageDir);
conststoragePath=join(storageDir,'storage.db');
conststoragePath=join(storageDir,'storage.db');
letstorage=newSQLiteStorageDatabase(storagePath);
letstorage=newSQLiteStorageDatabase(storagePath);
...
@@ -550,15 +515,9 @@ flakySuite('SQLite Storage Library', function () {
...
@@ -550,15 +515,9 @@ flakySuite('SQLite Storage Library', function () {
(isLinux?test.skip:test)('loads and is functional',async()=>{// TODO@RMacfarlane test seems to fail on Linux (Error: Unknown or unsupported transport 'disabled' for address 'disabled:')
if(platform.isLinux){
constkeytar=awaitimport('keytar');
// Skip test due to set up issue with Travis.
constname=`VSCode Test ${Math.floor(Math.random()*1e9)}`;