mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-02-15 13:00:32 -05:00
The remote backend tests spent most of their execution time sleeping in various polling and backoff waits. This is unnecessary when testing against a mock server, so reduce all of these delays when under test to much lower values. Only one remaining test has an artificial delay: verifying the discovery of services against an unknown hostname. This times out at DNS resolution, which is more difficult to fix than seems worth it at this time.
26 lines
448 B
Go
26 lines
448 B
Go
package remote
|
|
|
|
import (
|
|
"flag"
|
|
"os"
|
|
"testing"
|
|
"time"
|
|
|
|
_ "github.com/hashicorp/terraform/internal/logging"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
flag.Parse()
|
|
|
|
// Make sure TF_FORCE_LOCAL_BACKEND is unset
|
|
os.Unsetenv("TF_FORCE_LOCAL_BACKEND")
|
|
|
|
// Reduce delays to make tests run faster
|
|
backoffMin = 1.0
|
|
backoffMax = 1.0
|
|
planConfigurationVersionsPollInterval = 1 * time.Millisecond
|
|
runPollInterval = 1 * time.Millisecond
|
|
|
|
os.Exit(m.Run())
|
|
}
|