Skip to content

Commit c23a84b

Browse files
committed
Fix weird behaviour of Windows CI runners...
1 parent 3fcf4e7 commit c23a84b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: internal/integrationtest/environment.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package integrationtest
1717

1818
import (
1919
"testing"
20+
"time"
2021

2122
"github.com/arduino/go-paths-helper"
2223
"github.com/stretchr/testify/require"
@@ -43,7 +44,13 @@ func NewEnvironment(t *testing.T) *Environment {
4344
downloadsDir: downloadsDir,
4445
t: t,
4546
cleanUp: func() {
46-
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+
}
4754
},
4855
}
4956
}

0 commit comments

Comments
 (0)