summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_shortpathname.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-07-30 15:35:12 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-30 15:35:12 +0100
commit0f823c360947779d9de6048c6bce51c670a06eb6 (patch)
treef594cd5fa6337e85a430da71eaa817c983634816 /src/testdir/test_shortpathname.vim
parentde78632c41d870d5254e9ccd285f53674b955f4e (diff)
patch 9.0.0112: MS-Windows: test fails because file already existsv9.0.0112
Problem: MS-Windows: test fails because file already exists. Solution: Wait a little while until the file is gone.
Diffstat (limited to 'src/testdir/test_shortpathname.vim')
-rw-r--r--src/testdir/test_shortpathname.vim20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/testdir/test_shortpathname.vim b/src/testdir/test_shortpathname.vim
index 13fc07999d..79b7899c86 100644
--- a/src/testdir/test_shortpathname.vim
+++ b/src/testdir/test_shortpathname.vim
@@ -19,12 +19,22 @@ endfunc
func Test_ColonEight()
let save_dir = getcwd()
- " This could change for CygWin to //cygdrive/c
+ " This could change for CygWin to //cygdrive/c .
let dir1 = 'c:/x.x.y'
- if filereadable(dir1) || isdirectory(dir1)
- call assert_report("Fatal: '" . dir1 . "' exists, cannot run test")
- return
- endif
+ let trycount = 5
+ while 1
+ if !filereadable(dir1) && !isdirectory(dir1)
+ break
+ endif
+ if trycount == 1
+ call assert_report("Fatal: '" . dir1 . "' exists, cannot run this test")
+ return
+ endif
+ " When tests run in parallel the directory may exist, wait a bit until it
+ " is gone.
+ sleep 5
+ let trycount -= 1
+ endwhile
let file1 = dir1 . '/zz.y.txt'
let nofile1 = dir1 . '/z.y.txt'