Skip to content

Commit c071bed

Browse files
authored
test: fix file closing issue on windows (#764)
Fix file closing issue `The process cannot access the file because it is being used by another process.` on Windows for the test `TestStore_Dir_Push_SkipUnpack`. Signed-off-by: Shiwei Zhang <[email protected]>
1 parent 6fce64e commit c071bed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

content/file/file_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ func TestStore_Dir_Push_SkipUnpack(t *testing.T) {
690690
if err != nil {
691691
t.Fatal("failed to open internal gz")
692692
}
693+
defer pushedFile.Close()
693694
pushedContent, err := io.ReadAll(pushedFile)
694695
if err != nil {
695696
t.Fatal(err)

0 commit comments

Comments
 (0)