Add some better waits to prevent CA is nil test flakes (#7171)

This commit is contained in:
Matt Keeler 2020-01-29 22:23:11 -05:00 committed by GitHub
parent b8cac0d6e4
commit 50092c28c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -4767,6 +4767,7 @@ func TestAgentConnectCALeafCert_aclDefaultDeny(t *testing.T) {
a := NewTestAgent(t, t.Name(), TestACLConfig())
defer a.Shutdown()
testrpc.WaitForLeader(t, a.RPC, "dc1")
testrpc.WaitForActiveCARoot(t, a.RPC, "dc1", nil)
// Register a service with a managed proxy
{
@ -4802,6 +4803,7 @@ func TestAgentConnectCALeafCert_aclServiceWrite(t *testing.T) {
a := NewTestAgent(t, t.Name(), TestACLConfig())
defer a.Shutdown()
testrpc.WaitForLeader(t, a.RPC, "dc1")
testrpc.WaitForActiveCARoot(t, a.RPC, "dc1", nil)
// Register a service with a managed proxy
{
@ -4858,6 +4860,7 @@ func TestAgentConnectCALeafCert_aclServiceReadDeny(t *testing.T) {
a := NewTestAgent(t, t.Name(), TestACLConfig())
defer a.Shutdown()
testrpc.WaitForLeader(t, a.RPC, "dc1")
testrpc.WaitForActiveCARoot(t, a.RPC, "dc1", nil)
// Register a service with a managed proxy
{
@ -4912,6 +4915,7 @@ func TestAgentConnectCALeafCert_good(t *testing.T) {
a := NewTestAgent(t, t.Name(), "")
defer a.Shutdown()
testrpc.WaitForTestAgent(t, a.RPC, "dc1")
testrpc.WaitForActiveCARoot(t, a.RPC, "dc1", nil)
// CA already setup by default by NewTestAgent but force a new one so we can
// verify it was signed easily.
@ -5014,6 +5018,7 @@ func TestAgentConnectCALeafCert_goodNotLocal(t *testing.T) {
a := NewTestAgent(t, t.Name(), "")
defer a.Shutdown()
testrpc.WaitForTestAgent(t, a.RPC, "dc1")
testrpc.WaitForActiveCARoot(t, a.RPC, "dc1", nil)
// CA already setup by default by NewTestAgent but force a new one so we can
// verify it was signed easily.