From eaf2d9a185d9a33c19d9f92847b925a578806c76 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Thu, 24 Sep 2020 09:44:10 -0700 Subject: [PATCH] Improve failure message in an integration test for better debugging This seems to fail on CI when the Concourse workers get slow and kind stops working reliably. It would be interesting to see the error message in that case to figure out if there's anything we could do to make the test more resilient. --- test/integration/common_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/integration/common_test.go b/test/integration/common_test.go index 97a09f4b..3df4da63 100644 --- a/test/integration/common_test.go +++ b/test/integration/common_test.go @@ -169,9 +169,8 @@ func addTestClusterGroupCanViewEverythingRoleBinding(ctx context.Context, t *tes func addTestClusterRoleBinding(ctx context.Context, t *testing.T, adminClient kubernetes.Interface, binding *rbacv1.ClusterRoleBinding) { _, err := adminClient.RbacV1().ClusterRoleBindings().Get(ctx, binding.Name, metav1.GetOptions{}) if err != nil { - // "404 not found" errors are acceptable, but others would be unexpected statusError, isStatus := err.(*errors.StatusError) - require.True(t, isStatus) + require.True(t, isStatus, "Only StatusNotFound error would be acceptable, but error was: ", err.Error()) require.Equal(t, http.StatusNotFound, int(statusError.Status().Code)) _, err = adminClient.RbacV1().ClusterRoleBindings().Create(ctx, binding, metav1.CreateOptions{})