File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ func TestStorageDirDetectionWithOldVersions(t *testing.T) {
37
37
38
38
func TestStorageDirDetectionWithNewVersions (t * testing.T ) {
39
39
as := assert .New (t )
40
- testDir , err := os .MkdirTemp (os .TempDir (), "" )
41
- as .Nil (err )
40
+ testDir := t .TempDir ()
42
41
containerID := "abcd"
43
42
randomizedID := "xyz"
44
43
randomIDPath := path .Join (testDir , "image/aufs/layerdb/mounts/" , containerID )
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ func TestDirDiskUsage(t *testing.T) {
118
118
as := assert .New (t )
119
119
fsInfo , err := NewFsInfo (Context {})
120
120
as .NoError (err )
121
- dir , err := os . MkdirTemp ( os . TempDir (), "" )
121
+ dir := t . TempDir ()
122
122
as .NoError (err )
123
123
defer os .RemoveAll (dir )
124
124
dataSize := 1024 * 100 //100 KB
@@ -138,8 +138,7 @@ func TestDirInodeUsage(t *testing.T) {
138
138
as := assert .New (t )
139
139
fsInfo , err := NewFsInfo (Context {})
140
140
as .NoError (err )
141
- dir , err := os .MkdirTemp (os .TempDir (), "" )
142
- as .NoError (err )
141
+ dir := t .TempDir ()
143
142
defer os .RemoveAll (dir )
144
143
numFiles := 1000
145
144
for i := 0 ; i < numFiles ; i ++ {
You can’t perform that action at this time.
0 commit comments