diff --git a/agent/consul/helper_test.go b/agent/consul/helper_test.go index 48186b5486..0f89856d74 100644 --- a/agent/consul/helper_test.go +++ b/agent/consul/helper_test.go @@ -1213,10 +1213,12 @@ func registerTestRoutingConfigTopologyEntries(t *testing.T, codec rpc.ClientCode func registerLocalAndRemoteServicesVIPEnabled(t *testing.T, state *state.Store) { t.Helper() - _, entry, err := state.SystemMetadataGet(nil, structs.SystemMetadataVirtualIPsEnabled) - require.NoError(t, err) - require.NotNil(t, entry) - require.Equal(t, "true", entry.Value) + retry.Run(t, func(r *retry.R) { + _, entry, err := state.SystemMetadataGet(nil, structs.SystemMetadataVirtualIPsEnabled) + require.NoError(r, err) + require.NotNil(r, entry) + require.Equal(r, "true", entry.Value) + }) // Register a local connect-native service require.NoError(t, state.EnsureRegistration(10, &structs.RegisterRequest{ diff --git a/agent/consul/internal_endpoint_test.go b/agent/consul/internal_endpoint_test.go index 6d35f55b64..91d48601cd 100644 --- a/agent/consul/internal_endpoint_test.go +++ b/agent/consul/internal_endpoint_test.go @@ -2782,6 +2782,10 @@ func TestInternal_PeeredUpstreams(t *testing.T) { t.Skip("too slow for testing.Short") } + orig := virtualIPVersionCheckInterval + virtualIPVersionCheckInterval = 50 * time.Millisecond + t.Cleanup(func() { virtualIPVersionCheckInterval = orig }) + t.Parallel() _, s1 := testServerWithConfig(t)