Merge pull request #12489 from zhijianli88/cleanup-tmpfiles

Cleanup tmpfiles
This commit is contained in:
Sahdev Zala 2021-01-07 12:26:04 -05:00 committed by GitHub
commit c632042bb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,7 @@ func TestConfigFromFile(t *testing.T) {
continue continue
} }
if cerr != nil { if cerr != nil {
os.Remove(tmpfile.Name())
continue continue
} }

View File

@ -135,6 +135,7 @@ func TestZeroToEnd(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer os.Remove(f.Name())
defer f.Close() defer f.Close()
// Ensure 0 size is a nop so zero-to-end on an empty file won't give EINVAL. // Ensure 0 size is a nop so zero-to-end on an empty file won't give EINVAL.