Merge pull request #42343 from zzeebbii/fix-test-cleanup

Added missing test cleanup for temporary directory
This commit is contained in:
Tianon Gravi 2021-05-03 10:33:12 -07:00 committed by GitHub
commit 27a066ce53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,6 +33,7 @@ func TestCopyWithoutRange(t *testing.T) {
func TestCopyDir(t *testing.T) {
srcDir, err := ioutil.TempDir("", "srcDir")
assert.NilError(t, err)
defer os.RemoveAll(srcDir)
populateSrcDir(t, srcDir, 3)
dstDir, err := ioutil.TempDir("", "testdst")
@ -111,7 +112,7 @@ func doCopyTest(t *testing.T, copyWithFileRange, copyWithFileClone *bool) {
assert.NilError(t, err)
defer os.RemoveAll(dir)
srcFilename := filepath.Join(dir, "srcFilename")
dstFilename := filepath.Join(dir, "dstilename")
dstFilename := filepath.Join(dir, "dstFilename")
r := rand.New(rand.NewSource(0))
buf := make([]byte, 1024)