From 4e66984226fa2dab2f789ab9ba8f6bcb28f371fe Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Sat, 24 Oct 2020 14:32:16 -0700 Subject: [PATCH] Include message on reason-mismatch failures --- test/v1alpha1/wait.go | 2 +- test/wait.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/v1alpha1/wait.go b/test/v1alpha1/wait.go index bb87e1ce2e6..50f67b62562 100644 --- a/test/v1alpha1/wait.go +++ b/test/v1alpha1/wait.go @@ -210,7 +210,7 @@ func FailedWithReason(reason, name string) ConditionAccessorFn { if c.Reason == reason { return true, nil } - return true, fmt.Errorf("%q completed with the wrong reason: %s", name, c.Reason) + return true, fmt.Errorf("%q completed with the wrong reason: %s (message: %s)", name, c.Reason, c.Message) } else if c.Status == corev1.ConditionTrue { return true, fmt.Errorf("%q completed successfully, should have been failed with reason %q", name, reason) } diff --git a/test/wait.go b/test/wait.go index a3b6d7917ed..f896bb29eab 100644 --- a/test/wait.go +++ b/test/wait.go @@ -210,7 +210,7 @@ func FailedWithReason(reason, name string) ConditionAccessorFn { if c.Reason == reason { return true, nil } - return true, fmt.Errorf("%q completed with the wrong reason: %s", name, c.Reason) + return true, fmt.Errorf("%q completed with the wrong reason: %s (message: %s)", name, c.Reason, c.Message) } else if c.Status == corev1.ConditionTrue { return true, fmt.Errorf("%q completed successfully, should have been failed with reason %q", name, reason) }