mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
initwd Windows tests fixes (#1723)
Signed-off-by: eduzgun <emreduz00@gmail.com> Signed-off-by: Emre Duzgun <100037959+eduzgun@users.noreply.github.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -281,6 +282,11 @@ func TestDirFromModule_rel_submodules(t *testing.T) {
|
||||
}
|
||||
t.Cleanup(func() {
|
||||
os.Chdir(oldDir)
|
||||
// Trigger garbage collection to ensure that all open file handles are closed.
|
||||
// This prevents TempDir RemoveAll cleanup errors on Windows.
|
||||
if runtime.GOOS == "windows" {
|
||||
runtime.GC()
|
||||
}
|
||||
})
|
||||
|
||||
hooks := &testInstallHooks{}
|
||||
|
||||
Reference in New Issue
Block a user