From 0999e05a7d312d122342ce710c073e53a383c0cf Mon Sep 17 00:00:00 2001 From: "Chris S. Kim" Date: Wed, 27 Jul 2022 12:08:12 -0400 Subject: [PATCH] Reduce arm64 flakes for TestConnectCA_ConfigurationSet_ChangeKeyConfig_Primary There were 16 combinations of tests but 4 of them were duplicates since the default key type and bits were "ec" and 256. That entry was commented out to reduce the subtest count to 12. testrpc.WaitForLeader was failing on arm64 environments; the cause is unknown but it might be due to the environment being flooded with parallel tests making RPC calls. The RPC polling+retry was replaced with a simpler check for leadership based on raft. --- agent/consul/leader_connect_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/agent/consul/leader_connect_test.go b/agent/consul/leader_connect_test.go index 5e90de6b08..d9b3863865 100644 --- a/agent/consul/leader_connect_test.go +++ b/agent/consul/leader_connect_test.go @@ -36,7 +36,7 @@ func TestConnectCA_ConfigurationSet_ChangeKeyConfig_Primary(t *testing.T) { keyBits int }{ {connect.DefaultPrivateKeyType, connect.DefaultPrivateKeyBits}, - {"ec", 256}, + // {"ec", 256}, skip since values are same as Defaults {"ec", 384}, {"rsa", 2048}, {"rsa", 4096}, @@ -55,7 +55,7 @@ func TestConnectCA_ConfigurationSet_ChangeKeyConfig_Primary(t *testing.T) { providerState := map[string]string{"foo": "dc1-value"} // Initialize primary as the primary DC - dir1, srv := testServerWithConfig(t, func(c *Config) { + _, srv := testServerWithConfig(t, func(c *Config) { c.Datacenter = "dc1" c.PrimaryDatacenter = "dc1" c.Build = "1.6.0" @@ -63,12 +63,9 @@ func TestConnectCA_ConfigurationSet_ChangeKeyConfig_Primary(t *testing.T) { c.CAConfig.Config["PrivateKeyBits"] = src.keyBits c.CAConfig.Config["test_state"] = providerState }) - defer os.RemoveAll(dir1) - defer srv.Shutdown() codec := rpcClient(t, srv) - defer codec.Close() - testrpc.WaitForLeader(t, srv.RPC, "dc1") + waitForLeaderEstablishment(t, srv) testrpc.WaitForActiveCARoot(t, srv.RPC, "dc1", nil) var (