Skip to content

Commit 028a85d

Browse files
committed
controllers: cleanup TestStorageCopyFromPath files
Signed-off-by: Hidde Beydals <[email protected]>
1 parent 21a7dfe commit 028a85d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

controllers/storage_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,11 @@ func TestStorageCopyFromPath(t *testing.T) {
317317
}
318318

319319
createFile := func(file *File) (absPath string, err error) {
320-
defer func() {
321-
if err != nil && dir != "" {
322-
os.RemoveAll(dir)
323-
}
324-
}()
325320
dir, err = os.MkdirTemp("", "test-files-")
326321
if err != nil {
327322
return
328323
}
324+
t.Cleanup(cleanupStoragePath(dir))
329325
absPath = filepath.Join(dir, file.Name)
330326
if err = os.MkdirAll(filepath.Dir(absPath), 0755); err != nil {
331327
return

0 commit comments

Comments
 (0)