From 101f06ed6724b4d68d26df11933f5daa66d6a204 Mon Sep 17 00:00:00 2001 From: Rishabh Patel <66425093+rishabh-11@users.noreply.github.com> Date: Fri, 6 Jan 2023 16:46:18 +0530 Subject: [PATCH] Fix RetryUntilPredicate tests, upgrade go lang version to v1.19.4 (#73) * fix RetryUntilPredicate tests * upgrade go version to 1.19.4 --- .ci/pipeline_definitions | 6 +++--- Dockerfile | 2 +- internal/util/retry_test.go | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.ci/pipeline_definitions b/.ci/pipeline_definitions index 562a950f..7d07f185 100644 --- a/.ci/pipeline_definitions +++ b/.ci/pipeline_definitions @@ -27,11 +27,11 @@ dependency-watchdog: build: ~ steps: check: - image: 'golang:1.19.3' + image: 'golang:1.19.4' test-unit: - image: 'golang:1.19.3' + image: 'golang:1.19.4' build: - image: 'golang:1.19.3' + image: 'golang:1.19.4' output_dir: 'binary' jobs: diff --git a/Dockerfile b/Dockerfile index f694b27e..959d5fd6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19.3 AS builder +FROM golang:1.19.4 AS builder WORKDIR /go/src/github.com/gardener/dependency-watchdog COPY . . diff --git a/internal/util/retry_test.go b/internal/util/retry_test.go index 5adb060d..db4688a3 100644 --- a/internal/util/retry_test.go +++ b/internal/util/retry_test.go @@ -131,17 +131,12 @@ func TestRetryUntilPredicateForContextCancelled(t *testing.T) { } func TestRetryUntilPredicateWithBackgroundContext(t *testing.T) { - counter := 0 table := []struct { predicateFn func() bool expectedResult bool }{ {func() bool { return false }, false}, {func() bool { return true }, true}, - {func() bool { - counter++ - return counter%2 == 0 - }, true}, } for _, entry := range table { g := NewWithT(t) @@ -154,7 +149,6 @@ func TestRetryUntilPredicateWithBackgroundContext(t *testing.T) { }() wg.Wait() } - } func TestRetryOnError(t *testing.T) {