open-vault/helper/testhelpers/testhelpers_oss.go
Nick Cabatoff df61151034
Wait for standby to have a working grpc connection before we try to use it (#16905)
Also teach WaitForStandbyNode to do a better job waiting for standbys to be healthy.
2022-08-26 12:50:10 -04:00

20 lines
525 B
Go

//go:build !enterprise
package testhelpers
import (
"github.com/hashicorp/vault/vault"
"github.com/mitchellh/go-testing-interface"
)
// WaitForActiveNodeAndStandbys does nothing more than wait for the active node
// on OSS. On enterprise it waits for perf standbys to be healthy too.
func WaitForActiveNodeAndStandbys(t testing.T, cluster *vault.TestCluster) {
WaitForActiveNode(t, cluster)
for _, core := range cluster.Cores {
if standby, _ := core.Core.Standby(); standby {
WaitForStandbyNode(t, core)
}
}
}