diff --git a/Makefile b/Makefile index 58784725..946e3a35 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,7 @@ test-single-integration: .PHONY: test-relayer test-relayer: - cd $(RELAYER_DIR) && go clean -testcache && go test -v -mod=readonly -parallel=20 -timeout 1m ./... + cd $(RELAYER_DIR) && go clean -testcache && go test -v -mod=readonly -parallel=20 -timeout 30m -race ./... .PHONY: test-contract test-contract: diff --git a/integration-tests/contract.go b/integration-tests/contract.go index 8af17f67..ca71d03c 100644 --- a/integration-tests/contract.go +++ b/integration-tests/contract.go @@ -84,8 +84,16 @@ func DeployAndInstantiateContractV110( Amount: issueFee.Amount.AddRaw(2_000_000), }) + contactCfg := coreum.DefaultContractClientConfig(sdk.AccAddress(nil)) + + // integration tests are running in parallel producing the high load on the chain, as a result, periodically, + // with default gas adjustments, the tests might fail because of estimation delay and feemodel gas price change + // the custom gas adjustment config prevents the failure + contactCfg.GasAdjustment = 1.5 + contactCfg.GasPriceAdjustment = sdk.MustNewDecFromStr("1.5") + contractClient := coreum.NewContractClient( - coreum.DefaultContractClientConfig(sdk.AccAddress(nil)), + contactCfg, chains.Log, chains.Coreum.ClientContext, ) diff --git a/relayer/runner/config_test.go b/relayer/runner/config_test.go index 34da1585..80a547da 100644 --- a/relayer/runner/config_test.go +++ b/relayer/runner/config_test.go @@ -11,6 +11,7 @@ import ( "github.com/CoreumFoundation/coreumbridge-xrpl/relayer/runner" ) +//nolint:tparallel // the test is parallel, but test cases are not func TestInitAndReadConfig(t *testing.T) { t.Parallel() @@ -60,7 +61,7 @@ func TestInitAndReadConfig(t *testing.T) { for _, tc := range tests { tc := tc t.Run(tc.name, func(tt *testing.T) { - tt.Parallel() + // not parallel intentionally top prevent race // create temp dir to store the config tempDir := tt.TempDir() diff --git a/relayer/runner/runner_test.go b/relayer/runner/runner_test.go index 7482a769..75ffe032 100644 --- a/relayer/runner/runner_test.go +++ b/relayer/runner/runner_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "github.com/CoreumFoundation/coreum-tools/pkg/parallel" @@ -48,12 +49,6 @@ func (c *counter) Start(ctx context.Context) error { func Test_taskWithRestartOnError(t *testing.T) { t.Parallel() - zapLogger, err := logger.NewZapLogger(logger.ZapLoggerConfig{ - Level: "error", - Format: logger.YamlConsoleLoggerFormat, - }) - require.NoError(t, err) - tests := []struct { name string runTimeout time.Duration @@ -97,11 +92,16 @@ func Test_taskWithRestartOnError(t *testing.T) { c := newCounter() - err = parallel.Run(ctx, func(ctx context.Context, spawn parallel.SpawnFn) error { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + logMock := logger.NewAnyLogMock(ctrl) + logMock.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() + + err := parallel.Run(ctx, func(ctx context.Context, spawn parallel.SpawnFn) error { spawn(tc.name, parallel.Continue, func(ctx context.Context) error { tsk := taskWithRestartOnError( c.Start, - zapLogger, + logMock, tc.exitOnError, tc.retryDelay, )