From df7ff9f12830ce85f111acd86b917b16c831085c Mon Sep 17 00:00:00 2001 From: Snider Date: Sun, 1 Feb 2026 23:28:54 +0000 Subject: [PATCH] fix(test): use manual cleanup for TestDevOps_Boot_Good_FreshWithNoExisting Fixes flaky test that fails with "TempDir RemoveAll cleanup: directory not empty" by using os.MkdirTemp with t.Cleanup instead of t.TempDir(). This is the same fix applied to TestDevOps_Boot_Good_Success in 3423e48. Co-Authored-By: Claude Opus 4.5 --- pkg/devops/devops_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/devops/devops_test.go b/pkg/devops/devops_test.go index edb57427..65f45c9e 100644 --- a/pkg/devops/devops_test.go +++ b/pkg/devops/devops_test.go @@ -699,12 +699,14 @@ func TestDevOps_Stop_Bad_ContainerNotRunning(t *testing.T) { } func TestDevOps_Boot_Good_FreshWithNoExisting(t *testing.T) { - tempDir := t.TempDir() + tempDir, err := os.MkdirTemp("", "devops-boot-fresh-*") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(tempDir) }) t.Setenv("CORE_IMAGES_DIR", tempDir) // Create fake image imagePath := filepath.Join(tempDir, ImageName()) - err := os.WriteFile(imagePath, []byte("fake"), 0644) + err = os.WriteFile(imagePath, []byte("fake"), 0644) require.NoError(t, err) cfg := DefaultConfig()