fix(test): use manual cleanup for TestDevOps_Boot_Good_Success
The test was flaky because t.TempDir() fails cleanup when files are added asynchronously by the container manager. Using os.MkdirTemp with manual os.RemoveAll cleanup handles this gracefully. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
91d9217b38
commit
8effbda7cb
1 changed files with 4 additions and 2 deletions
|
|
@ -779,12 +779,14 @@ func TestDevOps_CheckUpdate_Delegates(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDevOps_Boot_Good_Success(t *testing.T) {
|
func TestDevOps_Boot_Good_Success(t *testing.T) {
|
||||||
tempDir := t.TempDir()
|
tempDir, err := os.MkdirTemp("", "devops-boot-success-*")
|
||||||
|
require.NoError(t, err)
|
||||||
|
t.Cleanup(func() { os.RemoveAll(tempDir) })
|
||||||
t.Setenv("CORE_IMAGES_DIR", tempDir)
|
t.Setenv("CORE_IMAGES_DIR", tempDir)
|
||||||
|
|
||||||
// Create fake image
|
// Create fake image
|
||||||
imagePath := filepath.Join(tempDir, ImageName())
|
imagePath := filepath.Join(tempDir, ImageName())
|
||||||
err := os.WriteFile(imagePath, []byte("fake"), 0644)
|
err = os.WriteFile(imagePath, []byte("fake"), 0644)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
cfg := DefaultConfig()
|
cfg := DefaultConfig()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue