We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3fcf4e7 commit c23a84bCopy full SHA for c23a84b
internal/integrationtest/environment.go
@@ -17,6 +17,7 @@ package integrationtest
17
18
import (
19
"testing"
20
+ "time"
21
22
"github.com/arduino/go-paths-helper"
23
"github.com/stretchr/testify/require"
@@ -43,7 +44,13 @@ func NewEnvironment(t *testing.T) *Environment {
43
44
downloadsDir: downloadsDir,
45
t: t,
46
cleanUp: func() {
- require.NoError(t, rootDir.RemoveAll())
47
+ err := rootDir.RemoveAll()
48
+ if err != nil {
49
+ // Sometimes antivirus keep files opened, allow some extra time
50
+ // to see if the cleanup can be completed
51
+ time.Sleep(5 * time.Second)
52
+ require.NoError(t, rootDir.RemoveAll())
53
+ }
54
},
55
}
56
0 commit comments