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) {
3737
3838func TestStorageDirDetectionWithNewVersions (t * testing.T ) {
3939 as := assert .New (t )
40- testDir , err := os .MkdirTemp (os .TempDir (), "" )
41- as .Nil (err )
40+ testDir := t .TempDir ()
4241 containerID := "abcd"
4342 randomizedID := "xyz"
4443 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) {
118118 as := assert .New (t )
119119 fsInfo , err := NewFsInfo (Context {})
120120 as .NoError (err )
121- dir , err := os . MkdirTemp ( os . TempDir (), "" )
121+ dir := t . TempDir ()
122122 as .NoError (err )
123123 defer os .RemoveAll (dir )
124124 dataSize := 1024 * 100 //100 KB
@@ -138,8 +138,7 @@ func TestDirInodeUsage(t *testing.T) {
138138 as := assert .New (t )
139139 fsInfo , err := NewFsInfo (Context {})
140140 as .NoError (err )
141- dir , err := os .MkdirTemp (os .TempDir (), "" )
142- as .NoError (err )
141+ dir := t .TempDir ()
143142 defer os .RemoveAll (dir )
144143 numFiles := 1000
145144 for i := 0 ; i < numFiles ; i ++ {
You can’t perform that action at this time.
0 commit comments