diff --git a/src/vs/platform/files/test/node/diskFileService.test.ts b/src/vs/platform/files/test/node/diskFileService.test.ts index 33b3a30717c..5e5694d8e0c 100644 --- a/src/vs/platform/files/test/node/diskFileService.test.ts +++ b/src/vs/platform/files/test/node/diskFileService.test.ts @@ -1696,7 +1696,9 @@ suite('Disk File Service', () => { assert.ok(!error); }); - test('watch - file', done => { + const runWatchTests = isLinux; + + (runWatchTests ? test : test.skip)('watch - file', done => { const toWatch = URI.file(join(testDir, 'index-watch1.html')); writeFileSync(toWatch.fsPath, 'Init'); @@ -1705,11 +1707,7 @@ suite('Disk File Service', () => { setTimeout(() => writeFileSync(toWatch.fsPath, 'Changes'), 50); }); - test('watch - file symbolic link', async done => { - if (isWindows) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - file symbolic link', async done => { const toWatch = URI.file(join(testDir, 'lorem.txt-linked')); await symlink(join(testDir, 'lorem.txt'), toWatch.fsPath); @@ -1718,11 +1716,7 @@ suite('Disk File Service', () => { setTimeout(() => writeFileSync(toWatch.fsPath, 'Changes'), 50); }); - test('watch - file - multiple writes', done => { - if (isWindows) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - file - multiple writes', done => { const toWatch = URI.file(join(testDir, 'index-watch1.html')); writeFileSync(toWatch.fsPath, 'Init'); @@ -1733,7 +1727,7 @@ suite('Disk File Service', () => { setTimeout(() => writeFileSync(toWatch.fsPath, 'Changes 3'), 20); }); - test('watch - file - delete file', done => { + (runWatchTests ? test : test.skip)('watch - file - delete file', done => { const toWatch = URI.file(join(testDir, 'index-watch1.html')); writeFileSync(toWatch.fsPath, 'Init'); @@ -1742,11 +1736,7 @@ suite('Disk File Service', () => { setTimeout(() => unlinkSync(toWatch.fsPath), 50); }); - test('watch - file - rename file', done => { - if (isWindows) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - file - rename file', done => { const toWatch = URI.file(join(testDir, 'index-watch1.html')); const toWatchRenamed = URI.file(join(testDir, 'index-watch1-renamed.html')); writeFileSync(toWatch.fsPath, 'Init'); @@ -1756,7 +1746,7 @@ suite('Disk File Service', () => { setTimeout(() => renameSync(toWatch.fsPath, toWatchRenamed.fsPath), 50); }); - test('watch - file - rename file (different case)', done => { + (runWatchTests ? test : test.skip)('watch - file - rename file (different case)', done => { const toWatch = URI.file(join(testDir, 'index-watch1.html')); const toWatchRenamed = URI.file(join(testDir, 'INDEX-watch1.html')); writeFileSync(toWatch.fsPath, 'Init'); @@ -1770,7 +1760,7 @@ suite('Disk File Service', () => { setTimeout(() => renameSync(toWatch.fsPath, toWatchRenamed.fsPath), 50); }); - test('watch - file (atomic save)', function (done) { + (runWatchTests ? test : test.skip)('watch - file (atomic save)', function (done) { const toWatch = URI.file(join(testDir, 'index-watch2.html')); writeFileSync(toWatch.fsPath, 'Init'); @@ -1786,11 +1776,7 @@ suite('Disk File Service', () => { }, 50); }); - test('watch - folder (non recursive) - change file', done => { - if (!isLinux) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - folder (non recursive) - change file', done => { const watchDir = URI.file(join(testDir, 'watch3')); mkdirSync(watchDir.fsPath); @@ -1802,11 +1788,7 @@ suite('Disk File Service', () => { setTimeout(() => writeFileSync(file.fsPath, 'Changes'), 50); }); - test('watch - folder (non recursive) - add file', done => { - if (!isLinux) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - folder (non recursive) - add file', done => { const watchDir = URI.file(join(testDir, 'watch4')); mkdirSync(watchDir.fsPath); @@ -1817,11 +1799,7 @@ suite('Disk File Service', () => { setTimeout(() => writeFileSync(file.fsPath, 'Changes'), 50); }); - test('watch - folder (non recursive) - delete file', done => { - if (!isLinux) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - folder (non recursive) - delete file', done => { const watchDir = URI.file(join(testDir, 'watch5')); mkdirSync(watchDir.fsPath); @@ -1833,11 +1811,7 @@ suite('Disk File Service', () => { setTimeout(() => unlinkSync(file.fsPath), 50); }); - test('watch - folder (non recursive) - add folder', done => { - if (!isLinux) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - folder (non recursive) - add folder', done => { const watchDir = URI.file(join(testDir, 'watch6')); mkdirSync(watchDir.fsPath); @@ -1848,11 +1822,7 @@ suite('Disk File Service', () => { setTimeout(() => mkdirSync(folder.fsPath), 50); }); - test('watch - folder (non recursive) - delete folder', done => { - if (!isLinux) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - folder (non recursive) - delete folder', done => { const watchDir = URI.file(join(testDir, 'watch7')); mkdirSync(watchDir.fsPath); @@ -1864,11 +1834,7 @@ suite('Disk File Service', () => { setTimeout(() => rimrafSync(folder.fsPath), 50); }); - test('watch - folder (non recursive) - symbolic link - change file', async done => { - if (!isLinux) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - folder (non recursive) - symbolic link - change file', async done => { const watchDir = URI.file(join(testDir, 'deep-link')); await symlink(join(testDir, 'deep'), watchDir.fsPath); @@ -1880,11 +1846,7 @@ suite('Disk File Service', () => { setTimeout(() => writeFileSync(file.fsPath, 'Changes'), 50); }); - test('watch - folder (non recursive) - rename file', done => { - if (!isLinux) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - folder (non recursive) - rename file', done => { const watchDir = URI.file(join(testDir, 'watch8')); mkdirSync(watchDir.fsPath); @@ -1898,11 +1860,7 @@ suite('Disk File Service', () => { setTimeout(() => renameSync(file.fsPath, fileRenamed.fsPath), 50); }); - test('watch - folder (non recursive) - rename file (different case)', done => { - if (!isLinux) { - return done(); // watch tests are flaky on other platforms - } - + (runWatchTests ? test : test.skip)('watch - folder (non recursive) - rename file (different case)', done => { const watchDir = URI.file(join(testDir, 'watch8')); mkdirSync(watchDir.fsPath);