Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2020-08-07 08:18:53 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-08-07 08:18:53 +0300
commit1231c4767ad6618323b7e961e355e9ef61c08f5f (patch)
treeec6ccba6c050e77155968b17ad9fa4e10ae27084
parentca640f810a5ec21647df1ef17b1ec319405d0001 (diff)
Update error log on polling failure435-use-exponential-backoff
-rw-r--r--internal/source/gitlab/gitlab_poll.go2
-rw-r--r--internal/source/gitlab/gitlab_poll_test.go3
2 files changed, 3 insertions, 2 deletions
diff --git a/internal/source/gitlab/gitlab_poll.go b/internal/source/gitlab/gitlab_poll.go
index 4dbc8754..bc1611ef 100644
--- a/internal/source/gitlab/gitlab_poll.go
+++ b/internal/source/gitlab/gitlab_poll.go
@@ -28,7 +28,7 @@ func (g *Gitlab) poll(interval, maxElapsedTime time.Duration) {
err := backoff.Retry(operation, backOff)
if err != nil {
- log.WithError(err).Errorf("Failed to connect to the internal GitLab API after %.2fs", interval.Seconds())
+ log.WithError(err).Errorf("Failed to connect to the internal GitLab API after %.2fs", maxElapsedTime.Seconds())
return
}
diff --git a/internal/source/gitlab/gitlab_poll_test.go b/internal/source/gitlab/gitlab_poll_test.go
index 6faaaa8a..8eecf210 100644
--- a/internal/source/gitlab/gitlab_poll_test.go
+++ b/internal/source/gitlab/gitlab_poll_test.go
@@ -68,7 +68,8 @@ func TestClient_Poll(t *testing.T) {
if tt.expectedFail {
require.False(t, glClient.isReady)
- require.Contains(t, hook.LastEntry().Message, "Failed to connect to the internal GitLab API after")
+ s := fmt.Sprintf("Failed to connect to the internal GitLab API after %.2fs", tt.maxTime.Seconds())
+ require.Equal(t, s, hook.LastEntry().Message)
return
}