Address more comments

This commit is contained in:
Shrenuj Bansal 2022-08-26 11:55:20 -04:00
parent b972e079b8
commit 217cc846c3
11 changed files with 33 additions and 35 deletions

View File

@ -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

View File

@ -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

2
go.sum
View File

@ -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=

View File

@ -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))
}

25
lib/retry/retry_test.go Normal file
View File

@ -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))
}

View File

@ -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

View File

@ -1,4 +1,4 @@
ARG GO_VERSION=1.17.9
ARG GO_VERSION=1.18.1
FROM golang:${GO_VERSION}-buster

View File

@ -1,4 +1,4 @@
ARG GO_VERSION=1.17.9
ARG GO_VERSION=1.18.1
FROM golang:${GO_VERSION}-buster as downloader

View File

@ -1,4 +1,4 @@
ARG GO_VERSION=1.17.9
ARG GO_VERSION=1.18.1
FROM golang:${GO_VERSION}-buster as downloader

View File

@ -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

View File

@ -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=