Skip to content

Commit

Permalink
Revert "core/internal/features/ocr2: parallelize subtests; extend tim…
Browse files Browse the repository at this point in the history
…eouts (#14754)"

This reverts commit ec35d77.
  • Loading branch information
erikburt committed Dec 20, 2024
1 parent 28d2549 commit 29d7785
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
2 changes: 0 additions & 2 deletions core/capabilities/compute/compute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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)))
Expand Down
6 changes: 2 additions & 4 deletions core/internal/cltest/cltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -1029,9 +1029,7 @@ func WaitForPipeline(t testing.TB, nodeID int, jobID int32, expectedPipelineRuns
jobID,
len(pr),
),
) {
t.Fatal()
}
)
return pr
}

Expand Down
10 changes: 3 additions & 7 deletions core/internal/features/ocr2/features_ocr2_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
9 changes: 3 additions & 6 deletions core/internal/features/ocr2/features_ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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])
Expand All @@ -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)
Expand Down

0 comments on commit 29d7785

Please sign in to comment.