neovim/test/functional/core
Justin M. Keyes ce0fddf5ae
feat: try to recover from missing tempdir #22573
Problem:
If vim_tempdir mysteriously goes missing (typically by "antivirus" on
Windows), any plugins using tempname() will be broken for the rest of
the session. #1432 #9833 https://groups.google.com/g/vim_use/c/ef55jNm5czI
Steps:
    mkdir foo
    TMPDIR=./foo nvim
    :echo tempname()
    !rm -r foo
    :echo tempname()
    tempname() still uses the foo path even though it was deleted.

Solution:
- Don't assume that vim_tempdir exists.
- If it goes missing once, retry vim_mktempdir and log (silently) an error.
- If it goes missing again, retry vim_mktempdir and show an error.

Rejected in Vim for performance reasons:
  https://groups.google.com/g/vim_use/c/qgRob9SWDv8/m/FAOFVVcDTv0J
  https://groups.google.com/g/vim_dev/c/cogp-Vye4oo/m/d_SVFXBbnnoJ
But, logging shows that `vim_gettempdir` is not called frequently.

Fixes #1432
Fixes #9833
Fixes #11250
Related: stdpath("run") f50135a32e
2023-03-09 05:07:36 -08:00
..
channels_spec.lua test: simplify platform detection (#21020) 2022-11-22 08:13:30 +08:00
exit_spec.lua test(exit_spec): make sure that autocommands are triggered (#22188) 2023-02-09 19:48:17 +08:00
fileio_spec.lua feat: try to recover from missing tempdir #22573 2023-03-09 05:07:36 -08:00
job_spec.lua test: simplify platform detection (#21020) 2022-11-22 08:13:30 +08:00
log_spec.lua refactor(tests): lift retry() into assert_log() 2023-01-17 00:19:30 +01:00
main_spec.lua fix(tui): more work in the TUI 2022-12-31 13:25:26 +01:00
path_spec.lua test: simplify platform detection (#21020) 2022-11-22 08:13:30 +08:00
remote_spec.lua test(remote_spec): reduce flakiness in waiting for client exit (#20230) 2022-09-17 16:17:51 +08:00
spellfile_spec.lua test: cleanup 2019-05-05 23:01:35 +02:00
startup_spec.lua refactor(tests): run unittests using main nvim binary in interpreter mode 2023-01-31 19:28:26 +01:00