api/testutil: Use fast fingerprint timeout in dev mode tests (#9285)

This commit is contained in:
Kris Hicks
2020-11-06 07:01:27 -08:00
committed by GitHub
parent 7b9f8b5cb1
commit b1f9d2221f

View File

@@ -76,7 +76,8 @@ type ServerConfig struct {
// ClientConfig is used to configure the client
type ClientConfig struct {
Enabled bool `json:"enabled"`
Enabled bool `json:"enabled"`
Options map[string]string `json:"options,omitempty"`
}
// VaultConfig is used to configure Vault
@@ -174,6 +175,13 @@ func NewTestServer(t testing.T, cb ServerConfigCallback) *TestServer {
cb(nomadConfig)
}
if nomadConfig.DevMode {
if nomadConfig.Client.Options == nil {
nomadConfig.Client.Options = map[string]string{}
}
nomadConfig.Client.Options["test.tighten_network_timeouts"] = "true"
}
configContent, err := json.Marshal(nomadConfig)
if err != nil {
t.Fatalf("err: %s", err)