From e2a92158affd168ab7c38a356e7c40029be77218 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Thu, 29 Oct 2020 18:32:01 -0700 Subject: [PATCH] Fix error path through test. In a downstream flake I saw this error: ``` timeout_test.go:234: Error waiting for TaskRun pipeline-task-timeout-hdwboxrg-pipelinetask1-2tqsx to be running: %!s() ``` This fixes the format string, and corrects what is likely a bug where `err` isn't properly set when printed. --- test/timeout_test.go | 4 ++-- test/v1alpha1/timeout_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/timeout_test.go b/test/timeout_test.go index 321a2ef4abb..3eb99231c67 100644 --- a/test/timeout_test.go +++ b/test/timeout_test.go @@ -107,8 +107,8 @@ func TestPipelineRunTimeout(t *testing.T) { } for i := 1; i <= len(taskrunList.Items); i++ { - if <-errChan != nil { - t.Errorf("Error waiting for TaskRun %s to be running: %s", taskrunList.Items[i-1].Name, err) + if err := <-errChan; err != nil { + t.Errorf("Error waiting for TaskRun %s to be running: %v", taskrunList.Items[i-1].Name, err) } } diff --git a/test/v1alpha1/timeout_test.go b/test/v1alpha1/timeout_test.go index 31cf97720b8..5d68f08559e 100644 --- a/test/v1alpha1/timeout_test.go +++ b/test/v1alpha1/timeout_test.go @@ -230,8 +230,8 @@ func TestPipelineTaskTimeout(t *testing.T) { } for i := 1; i <= len(taskrunList.Items); i++ { - if <-errChan != nil { - t.Errorf("Error waiting for TaskRun %s to be running: %s", taskrunList.Items[i-1].Name, err) + if err := <-errChan; err != nil { + t.Errorf("Error waiting for TaskRun %s to be running: %v", taskrunList.Items[i-1].Name, err) } }