diff --git a/core/internal/features/ocr2/features_ocr2_test.go b/core/internal/features/ocr2/features_ocr2_test.go index 9160310261f..54aaac07622 100644 --- a/core/internal/features/ocr2/features_ocr2_test.go +++ b/core/internal/features/ocr2/features_ocr2_test.go @@ -26,6 +26,7 @@ import ( "github.com/onsi/gomega" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/zap" "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" @@ -35,6 +36,7 @@ import ( ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -133,6 +135,7 @@ func setupNodeOCR2( c.EVM[0].LogPollInterval = commonconfig.MustNewDuration(5 * time.Second) c.EVM[0].Transactions.ForwardersEnabled = &useForwarder }) + config.SetLogLevel(zap.WarnLevel) app := cltest.NewApplicationWithConfigV2AndKeyOnSimulatedBlockchain(t, config, b, p2pKey) @@ -203,9 +206,11 @@ func testIntegration_OCR2(t *testing.T) { } { test := test t.Run(test.name, func(t *testing.T) { + t.Parallel() owner, b, ocrContractAddress, ocrContract := setupOCR2Contracts(t) lggr := logger.TestLogger(t) + lggr.SetLogLevel(zap.WarnLevel) bootstrapNodePort := freeport.GetOne(t) bootstrapNode := setupNodeOCR2(t, owner, bootstrapNodePort, false /* useForwarders */, b, nil) @@ -561,11 +566,13 @@ updateInterval = "1m" // Trail #1: 4 oracles reporting 0, 10, 20, 30. Answer should be 20 (results[4/2]). // Trial #2: 4 oracles reporting 0, 20, 40, 60. Answer should be 40 (results[4/2]). - gomega.NewGomegaWithT(t).Eventually(func() string { + if !gomega.NewGomegaWithT(t).Eventually(func() string { answer, err2 := ocrContract.LatestAnswer(nil) require.NoError(t, err2) return answer.String() - }, 1*time.Minute, 200*time.Millisecond).Should(gomega.Equal(fmt.Sprintf("%d", 2*retVal))) + }, tests.WaitTimeout(t), 200*time.Millisecond).Should(gomega.Equal(fmt.Sprintf("%d", 2*retVal))) { + t.Fatal() + } for _, app := range apps { jobs, _, err2 := app.JobORM().FindJobs(ctx, 0, 1000) @@ -886,11 +893,13 @@ updateInterval = "1m" wg.Wait() // 4 oracles reporting 0, 10, 20, 30. Answer should be 20 (results[4/2]). - gomega.NewGomegaWithT(t).Eventually(func() string { + if !gomega.NewGomegaWithT(t).Eventually(func() string { answer, err := ocrContract.LatestAnswer(nil) require.NoError(t, err) return answer.String() - }, 1*time.Minute, 200*time.Millisecond).Should(gomega.Equal("20")) + }, tests.WaitTimeout(t), 200*time.Millisecond).Should(gomega.Equal("20")) { + t.Fatal() + } for _, app := range apps { jobs, _, err := app.JobORM().FindJobs(ctx, 0, 1000) diff --git a/tools/bin/go_core_tests b/tools/bin/go_core_tests index f7c1dfaf231..0b68bc7700d 100755 --- a/tools/bin/go_core_tests +++ b/tools/bin/go_core_tests @@ -19,7 +19,7 @@ use_tee() { cat > "$@" fi } -go test -json -ldflags "$GO_LDFLAGS" -tags integration $TEST_FLAGS -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $1 | use_tee $OUTPUT_FILE +go test -timeout 15m -json -ldflags "$GO_LDFLAGS" -tags integration $TEST_FLAGS -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt $1 | use_tee $OUTPUT_FILE EXITCODE=${PIPESTATUS[0]} # Assert no known sensitive strings present in test logger output