Skip to content

Commit

Permalink
test: fix file closing issue on windows (oras-project#764)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
shizhMSFT authored May 11, 2024
1 parent 6fce64e commit c071bed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions content/file/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ func TestStore_Dir_Push_SkipUnpack(t *testing.T) {
if err != nil {
t.Fatal("failed to open internal gz")
}
defer pushedFile.Close()
pushedContent, err := io.ReadAll(pushedFile)
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit c071bed

Please sign in to comment.