Sync Neovim's plugins once more if Neovim crashes

Neovim 0.12.6 segfaulted on the way out after a finished Lazy! sync
(report CD-P8RUBS), and the update step failed though the plugins were
up to date. If nvim dies from a signal, run the sync once more; it
fails if Neovim crashes again, and an ordinary failure isn't retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 06:10:38 -07:00
co-authored by Claude Opus 5.5
parent d1108698bb
commit 902967f111
2 changed files with 40 additions and 1 deletions
+29
View File
@@ -70,3 +70,32 @@ update_neovim() {
[ -f "$LAZY/lazy.nvim/untracked.so" ]
[ ! -e "$BACKUPS" ]
}
@test "a sync that crashes Neovim is run once more" {
plugin lazy.nvim
# Crash the first time only
stub nvim '[ -e "$HOME/crashed" ] && exit 0; touch "$HOME/crashed"; exit 139'
run update_neovim
[ "$status" -eq 0 ]
[[ "$output" == *"Neovim crashed (signal 11)"* ]]
[ "$(grep -c '^nvim ' "$STUB_LOG")" -eq 2 ]
}
@test "a sync that crashes Neovim twice fails" {
plugin lazy.nvim
stub nvim 'exit 139'
run update_neovim
[ "$status" -eq 139 ]
[ "$(grep -c '^nvim ' "$STUB_LOG")" -eq 2 ]
}
@test "a sync that fails without crashing isn't run again" {
plugin lazy.nvim
stub nvim 'exit 1'
run update_neovim
[ "$status" -eq 1 ]
[ "$(grep -c '^nvim ' "$STUB_LOG")" -eq 1 ]
}