mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
fix TestApply_plan_backup test on Windows by using garbage collection (#3320)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
This commit is contained in:
committed by
GitHub
parent
bdcf1f5e6e
commit
e5e9bcd163
@@ -12,6 +12,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
@@ -754,6 +755,10 @@ func TestApply_plan_backup(t *testing.T) {
|
||||
|
||||
// Should have a backup file
|
||||
testStateRead(t, backupPath)
|
||||
|
||||
// Force a garbage collection to ensure the backup file is closed
|
||||
// to avoid TempDir RemoveAll cleanup errors on Windows.
|
||||
runtime.GC()
|
||||
}
|
||||
|
||||
func TestApply_plan_noBackup(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user