From ce02cf3c9d392251bd3492372d8b70527c6f3d77 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 29 Mar 2026 00:04:32 -0700 Subject: [PATCH] stabilize FUSE git reset recovery (#8825) --- test/fuse_integration/git_operations_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/fuse_integration/git_operations_test.go b/test/fuse_integration/git_operations_test.go index 66667d734..2aae86c89 100644 --- a/test/fuse_integration/git_operations_test.go +++ b/test/fuse_integration/git_operations_test.go @@ -431,6 +431,17 @@ func resetToCommitWithRecovery(t *testing.T, bareRepo, localClone, mountClone, c } continue } + // Verify git commands actually work in the directory — the kernel + // dcache can transiently show the dir then lose it after reset. + if _, err := tryGitCommand(mountClone, "rev-parse", "HEAD"); err != nil { + lastErr = fmt.Errorf("post-reset verification failed: %w", err) + if attempt < maxAttempts { + t.Logf("reset recovery attempt %d: %v — removing clone for re-create", attempt, lastErr) + os.RemoveAll(mountClone) + time.Sleep(2 * time.Second) + } + continue + } return } require.NoError(t, lastErr, "git reset --hard %s failed after %d recovery attempts", commit, maxAttempts)