From bd84cd4c0eeb63f686cf0d7fdddb79c889144e53 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 21 Sep 2023 12:19:27 -0700 Subject: [PATCH] Fix flaky test: Test_Render_Multiple_Routes (#6333) --- pkg/corerp/renderers/gateway/render_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/corerp/renderers/gateway/render_test.go b/pkg/corerp/renderers/gateway/render_test.go index dab84c49f1..2621183de6 100644 --- a/pkg/corerp/renderers/gateway/render_test.go +++ b/pkg/corerp/renderers/gateway/render_test.go @@ -34,6 +34,7 @@ import ( resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" + "golang.org/x/exp/slices" ) const ( @@ -1473,6 +1474,10 @@ func validateHTTPProxy(t *testing.T, outputResources []rpv1.OutputResource, expe } } + // Sort the dependencies so that tests aren't flaky + slices.Sort(expectedHTTPProxyOutputResource.CreateResource.Dependencies) + slices.Sort(httpProxyOutputResource.CreateResource.Dependencies) + require.Equal(t, expectedHTTPProxyOutputResource, httpProxyOutputResource) require.Equal(t, kubernetes.NormalizeResourceName(resourceName), httpProxy.Name) require.Equal(t, applicationName, httpProxy.Namespace)