-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_backup.vim
tests fail when built under /tmp
#3301
Comments
### Summary
The tests in `test_backup.vim` as introduced in b782ba4#diff-56cbec7ca8be0936c91499a3c49255c7 fail when the filesystem is mounted with `noatime`.
Tests pass when the filesystem is mounted e.g. `relatime`.
(Not sure if this is the tests, the changes as introduced, or that it has never "worked" but it's now being tested.)
Are you sure this is caused by "noatime" and not another difference? I
don't think the code depends on the last access time.
### Test failure output
```
Executed 398 tests
3 FAILED:
Found errors in Test_backup():
Caught exception in Test_backup(): Vim(let):E484: Can't open file Xbackup.txt~ @ function RunTheTest[40]..Test_backup, line 9
This indicates a different error from what "no access time" would do.
…--
An indication you must be a manager:
You feel sorry for Dilbert's boss.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Perhaps somehow backupskip kicks in? |
You know, I spent two or three hours last night narrowing down the issue and I was pretty certain it was due to So, these steps don't work to replicate:
However, when I try to build in Wat. So, it appears something here is being messed up by whatever is "special" about this particular tmpfs. This doesn't make a lot of sense to me; I'll do more digging. (Just to confirm it's not running out of space:
|
This is expected, because quoting the documentation:
I have run previously into this problem. Perhaps this patch is needed in addition: diff --git a/src/testdir/test_backup.vim b/src/testdir/test_backup.vim
index 0981efdce..ce2bfe72b 100644
--- a/src/testdir/test_backup.vim
+++ b/src/testdir/test_backup.vim
@@ -1,7 +1,7 @@
" Tests for the backup function
func Test_backup()
- set backup backupdir=.
+ set backup backupdir=. backupskip=
new
call setline(1, ['line1', 'line2'])
:f Xbackup.txt
@@ -12,13 +12,13 @@ func Test_backup()
let l = readfile('Xbackup.txt~')
call assert_equal(['line1', 'line2'], l)
bw!
- set backup&vim backupdir&vim
+ set backup&vim backupdir&vim backupskip&vim
call delete('Xbackup.txt')
call delete('Xbackup.txt~')
endfunc
func Test_backup2()
- set backup backupdir=.//
+ set backup backupdir=.// backupskip=
new
call setline(1, ['line1', 'line2', 'line3'])
:f Xbackup.txt
@@ -34,11 +34,11 @@ func Test_backup2()
bw!
call delete('Xbackup.txt')
call delete(f)
- set backup&vim backupdir&vim
+ set backup&vim backupdir&vim backupskip&vim
endfunc
func Test_backup2_backupcopy()
- set backup backupdir=.// backupcopy=yes
+ set backup backupdir=.// backupcopy=yes backupskip=
new
call setline(1, ['line1', 'line2', 'line3'])
:f Xbackup.txt
@@ -54,5 +54,5 @@ func Test_backup2_backupcopy()
bw!
call delete('Xbackup.txt')
call delete(f)
- set backup&vim backupdir&vim backupcopy&vim
+ set backup&vim backupdir&vim backupcopy&vim backupskip&vim
endfunc |
Yup, that got the tests passing. I'll edit the issue title to fit the actual reason for the test failures. |
test_backup.vim
tests fail when filesystem mounted noatime
test_backup.vim
tests fail when built under /tmp
Problem: Backup tests fail when CWD is in /tmp. Solution: Make 'backupskip' empty. (Christian Brabandt, closes vim/vim#3301) vim/vim@efe0373
Problem: Backup tests fail when CWD is in /tmp. Solution: Make 'backupskip' empty. (Christian Brabandt, closes vim/vim#3301) vim/vim@efe0373
Problem: Backup tests fail when CWD is in /tmp. Solution: Make 'backupskip' empty. (Christian Brabandt, closes vim/vim#3301) vim/vim@efe0373
Edit: Issue title changed; real reason was due to documented behaviour of skipping backup files in temporary locations, see @chrisbra's reply below.
Summary
The tests in
test_backup.vim
as introduced in b782ba4#diff-56cbec7ca8be0936c91499a3c49255c7 fail when the filesystem is mounted withnoatime
.Tests pass when the filesystem is mounted e.g.
relatime
.(Not sure if this is the tests, the changes as introduced, or that it has never "worked" but it's now being tested.)
Test failure output
The text was updated successfully, but these errors were encountered: