From 217cc846c337a819dbba436192a0adb8d1ffbcd6 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Fri, 26 Aug 2022 11:55:20 -0400 Subject: [PATCH] Address more comments --- .circleci/config.yml | 5 ---- .github/workflows/codeql-analysis.yml | 2 +- go.sum | 2 +- itests/retry_test.go | 22 ---------------- lib/retry/retry_test.go | 25 +++++++++++++++++++ testplans/composer/Dockerfile | 2 +- .../docker-images/Dockerfile.oni-buildbase | 2 +- .../docker-images/Dockerfile.oni-runtime | 2 +- .../Dockerfile.oni-runtime-debug | 2 +- testplans/lotus-soup/go.mod | 2 +- testplans/lotus-soup/go.sum | 2 +- 11 files changed, 33 insertions(+), 35 deletions(-) delete mode 100644 itests/retry_test.go create mode 100644 lib/retry/retry_test.go diff --git a/.circleci/config.yml b/.circleci/config.yml index b4fcddbca..cb250cad9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -959,11 +959,6 @@ workflows: suite: itest-paych_cli target: "./itests/paych_cli_test.go" - - test: - name: test-itest-retry - suite: itest-retry - target: "./itests/retry_test.go" - - test: name: test-itest-sdr_upgrade suite: itest-sdr_upgrade diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a86b077b8..70d15c60c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,7 +37,7 @@ jobs: - uses: actions/setup-go@v1 with: - go-version: '1.17.9' + go-version: '1.18.1' # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/go.sum b/go.sum index 184b7950b..54ba802f7 100644 --- a/go.sum +++ b/go.sum @@ -1525,7 +1525,7 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/Op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333 h1:CznVS40zms0Dj5he4ERo+fRPtO0qxUk8lA8Xu3ddet0= github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333/go.mod h1:Ag6rSXkHIckQmjFBCweJEEt1mrTPBv8b9W4aU/NQWfI= github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= diff --git a/itests/retry_test.go b/itests/retry_test.go deleted file mode 100644 index 53ec90b56..000000000 --- a/itests/retry_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package itests - -import ( - "testing" - - "github.com/stretchr/testify/require" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-jsonrpc" - - "github.com/filecoin-project/lotus/lib/retry" -) - -func TestRetryErrorIsInTrue(t *testing.T) { - errorsToRetry := []error{&jsonrpc.RPCConnectionError{}} - require.True(t, retry.ErrorIsIn(&jsonrpc.RPCConnectionError{}, errorsToRetry)) -} - -func TestRetryErrorIsInFalse(t *testing.T) { - errorsToRetry := []error{&jsonrpc.RPCConnectionError{}} - require.False(t, retry.ErrorIsIn(xerrors.Errorf("random error"), errorsToRetry)) -} diff --git a/lib/retry/retry_test.go b/lib/retry/retry_test.go new file mode 100644 index 000000000..a60d47db2 --- /dev/null +++ b/lib/retry/retry_test.go @@ -0,0 +1,25 @@ +package retry + +import ( + "testing" + + "github.com/stretchr/testify/require" + "golang.org/x/xerrors" + + "github.com/filecoin-project/go-jsonrpc" +) + +func TestRetryErrorIsInTrue(t *testing.T) { + errorsToRetry := []error{&jsonrpc.RPCConnectionError{}} + require.True(t, ErrorIsIn(&jsonrpc.RPCConnectionError{}, errorsToRetry)) +} + +func TestRetryErrorIsInFalse(t *testing.T) { + errorsToRetry := []error{&jsonrpc.RPCConnectionError{}} + require.False(t, ErrorIsIn(xerrors.Errorf("random error"), errorsToRetry)) +} + +func TestRetryWrappedErrorIsInTrue(t *testing.T) { + errorsToRetry := []error{&jsonrpc.RPCConnectionError{}} + require.True(t, ErrorIsIn(xerrors.Errorf("wrapped: %w", &jsonrpc.RPCConnectionError{}), errorsToRetry)) +} diff --git a/testplans/composer/Dockerfile b/testplans/composer/Dockerfile index fc8ee0158..d53bef7e4 100644 --- a/testplans/composer/Dockerfile +++ b/testplans/composer/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.17.9-buster as tg-build +FROM golang:1.18.1-buster as tg-build ARG TESTGROUND_REF="oni" WORKDIR /usr/src diff --git a/testplans/docker-images/Dockerfile.oni-buildbase b/testplans/docker-images/Dockerfile.oni-buildbase index fd5f98a67..33420f4a6 100644 --- a/testplans/docker-images/Dockerfile.oni-buildbase +++ b/testplans/docker-images/Dockerfile.oni-buildbase @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.17.9 +ARG GO_VERSION=1.18.1 FROM golang:${GO_VERSION}-buster diff --git a/testplans/docker-images/Dockerfile.oni-runtime b/testplans/docker-images/Dockerfile.oni-runtime index e2327f2af..e18ca3bbc 100644 --- a/testplans/docker-images/Dockerfile.oni-runtime +++ b/testplans/docker-images/Dockerfile.oni-runtime @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.17.9 +ARG GO_VERSION=1.18.1 FROM golang:${GO_VERSION}-buster as downloader diff --git a/testplans/docker-images/Dockerfile.oni-runtime-debug b/testplans/docker-images/Dockerfile.oni-runtime-debug index 8d1e411a1..33954c92f 100644 --- a/testplans/docker-images/Dockerfile.oni-runtime-debug +++ b/testplans/docker-images/Dockerfile.oni-runtime-debug @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.17.9 +ARG GO_VERSION=1.18.1 FROM golang:${GO_VERSION}-buster as downloader diff --git a/testplans/lotus-soup/go.mod b/testplans/lotus-soup/go.mod index c7c313c6f..040360d13 100644 --- a/testplans/lotus-soup/go.mod +++ b/testplans/lotus-soup/go.mod @@ -1,6 +1,6 @@ module github.com/filecoin-project/lotus/testplans/lotus-soup -go 1.17 +go 1.18 require ( contrib.go.opencensus.io/exporter/prometheus v0.4.0 diff --git a/testplans/lotus-soup/go.sum b/testplans/lotus-soup/go.sum index 48a908640..66c9ea416 100644 --- a/testplans/lotus-soup/go.sum +++ b/testplans/lotus-soup/go.sum @@ -2049,7 +2049,7 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/Op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333/go.mod h1:Ag6rSXkHIckQmjFBCweJEEt1mrTPBv8b9W4aU/NQWfI= github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=