mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
fix: DirFromModule related tests on Windows (#3289)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
This commit is contained in:
committed by
GitHub
parent
aa403e5f99
commit
767dd7a2fa
5
go.mod
5
go.mod
@@ -3,7 +3,10 @@ module github.com/opentofu/opentofu
|
||||
// At the time of adding this configuration, the new Go feature introduced here https://github.com/golang/go/issues/67061,
|
||||
// was having a good amount of issues linked to, affecting AWS Firewall, GCP various services and a lot more.
|
||||
// In go1.23 the godebug flag for this was named 'tlskyber', renamed in go1.24 to 'tlsmlkem'. https://tip.golang.org/doc/godebug#go-124
|
||||
godebug tlsmlkem=0
|
||||
godebug (
|
||||
tlsmlkem=0
|
||||
winsymlink=0 // See https://github.com/opentofu/opentofu/pull/3289
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/kms v1.15.5
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -118,6 +119,14 @@ func TestInit_fromModule_cwdDest(t *testing.T) {
|
||||
func TestInit_fromModule_dstInSrc(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
t.Chdir(dir)
|
||||
|
||||
defer func() {
|
||||
// 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()
|
||||
}
|
||||
}()
|
||||
if err := os.Mkdir("foo", os.ModePerm); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user