From 4c8a21a9cca691492be7037ccc6b3f85cda6c7e9 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Fri, 20 Dec 2024 16:26:45 -0500 Subject: [PATCH] Revert "core/internal/features/ocr2: parallelize subtests; extend timeouts (#14754)" (#15792) This reverts commit ec35d77281f8df4d3021c7c94124cc32a2ac5f92. --- core/capabilities/compute/compute_test.go | 2 -- core/internal/cltest/cltest.go | 6 ++---- core/internal/features/ocr2/features_ocr2_helper.go | 10 +++------- core/internal/features/ocr2/features_ocr2_test.go | 9 +++------ 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/core/capabilities/compute/compute_test.go b/core/capabilities/compute/compute_test.go index 1b1b6e643e8..3e5f501fa61 100644 --- a/core/capabilities/compute/compute_test.go +++ b/core/capabilities/compute/compute_test.go @@ -77,7 +77,6 @@ func setup(t *testing.T, config Config) testHarness { } func TestComputeStartAddsToRegistry(t *testing.T) { - t.Parallel() th := setup(t, defaultConfig) require.NoError(t, th.compute.Start(tests.Context(t))) @@ -110,7 +109,6 @@ func TestComputeExecuteMissingConfig(t *testing.T) { } func TestComputeExecuteMissingBinary(t *testing.T) { - t.Parallel() th := setup(t, defaultConfig) require.NoError(t, th.compute.Start(tests.Context(t))) diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index b8b34919b6e..a55c57cc9a2 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -999,7 +999,7 @@ func WaitForPipeline(t testing.TB, nodeID int, jobID int32, expectedPipelineRuns t.Helper() var pr []pipeline.Run - if !gomega.NewWithT(t).Eventually(func() bool { + gomega.NewWithT(t).Eventually(func() bool { prs, _, err := jo.PipelineRuns(testutils.Context(t), &jobID, 0, 1000) require.NoError(t, err) @@ -1029,9 +1029,7 @@ func WaitForPipeline(t testing.TB, nodeID int, jobID int32, expectedPipelineRuns jobID, len(pr), ), - ) { - t.Fatal() - } + ) return pr } diff --git a/core/internal/features/ocr2/features_ocr2_helper.go b/core/internal/features/ocr2/features_ocr2_helper.go index 76056d7d23d..9287d0df5b1 100644 --- a/core/internal/features/ocr2/features_ocr2_helper.go +++ b/core/internal/features/ocr2/features_ocr2_helper.go @@ -35,7 +35,6 @@ 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/services/ocr2/testhelpers" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" @@ -202,7 +201,6 @@ func RunTestIntegrationOCR2(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) @@ -558,7 +556,7 @@ updateInterval = "1m" return } // Want at least 2 runs so we see all the metadata. - pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], len(completedRuns)+2, 7, apps[ic].JobORM(), tests.WaitTimeout(t), 5*time.Second) + pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], len(completedRuns)+2, 7, apps[ic].JobORM(), 2*time.Minute, 5*time.Second) jb, err2 := pr[0].Outputs.MarshalJSON() if !assert.NoError(t, err2) { return @@ -570,13 +568,11 @@ 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]). - if !gomega.NewGomegaWithT(t).Eventually(func() string { + gomega.NewGomegaWithT(t).Eventually(func() string { answer, err2 := ocrContract.LatestAnswer(nil) require.NoError(t, err2) return answer.String() - }, tests.WaitTimeout(t), 200*time.Millisecond).Should(gomega.Equal(strconv.Itoa(2 * retVal))) { - t.Fatal() - } + }, 1*time.Minute, 200*time.Millisecond).Should(gomega.Equal(strconv.Itoa(2 * retVal))) for _, app := range apps { jobs, _, err2 := app.JobORM().FindJobs(ctx, 0, 1000) diff --git a/core/internal/features/ocr2/features_ocr2_test.go b/core/internal/features/ocr2/features_ocr2_test.go index a8a8886c50c..01c269d19e3 100644 --- a/core/internal/features/ocr2/features_ocr2_test.go +++ b/core/internal/features/ocr2/features_ocr2_test.go @@ -27,7 +27,6 @@ import ( confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -225,7 +224,7 @@ updateInterval = "1m" go func() { defer wg.Done() // Want at least 2 runs so we see all the metadata. - pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], 2, 7, apps[ic].JobORM(), tests.WaitTimeout(t), 5*time.Second) + pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], 2, 7, apps[ic].JobORM(), 2*time.Minute, 5*time.Second) jb, err := pr[0].Outputs.MarshalJSON() require.NoError(t, err) assert.Equal(t, []byte(fmt.Sprintf("[\"%d\"]", 10*ic)), jb, "pr[0] %+v pr[1] %+v", pr[0], pr[1]) @@ -235,13 +234,11 @@ updateInterval = "1m" wg.Wait() // 4 oracles reporting 0, 10, 20, 30. Answer should be 20 (results[4/2]). - if !gomega.NewGomegaWithT(t).Eventually(func() string { + gomega.NewGomegaWithT(t).Eventually(func() string { answer, err := ocrContract.LatestAnswer(nil) require.NoError(t, err) return answer.String() - }, tests.WaitTimeout(t), 200*time.Millisecond).Should(gomega.Equal("20")) { - t.Fatal() - } + }, 1*time.Minute, 200*time.Millisecond).Should(gomega.Equal("20")) for _, app := range apps { jobs, _, err := app.JobORM().FindJobs(ctx, 0, 1000)