From 91f252603b665afe5078765b79f2245058617cca Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Mon, 30 Dec 2024 13:56:46 -0800 Subject: [PATCH] chore: increase timeouts in workflow_syncer_test --- .../workflows/syncer/workflow_syncer_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go b/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go index 6b3f7c7018d..4fd812856d3 100644 --- a/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go +++ b/core/services/relay/evm/capabilities/workflows/syncer/workflow_syncer_test.go @@ -22,6 +22,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink-common/pkg/workflows" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" coretestutils "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -151,7 +152,7 @@ func Test_EventHandlerStateSync(t *testing.T) { require.Eventually(t, func() bool { numEvents := len(testEventHandler.GetEvents()) return numEvents == numberWorkflows - }, 5*time.Second, time.Second) + }, tests.WaitTimeout(t), 100*time.Millisecond) for _, event := range testEventHandler.GetEvents() { assert.Equal(t, syncer.WorkflowRegisteredEvent, event.GetEventType()) @@ -216,7 +217,7 @@ func Test_EventHandlerStateSync(t *testing.T) { } return false - }, 50*time.Second, time.Second) + }, tests.WaitTimeout(t), 100*time.Millisecond) } func Test_InitialStateSync(t *testing.T) { @@ -276,7 +277,7 @@ func Test_InitialStateSync(t *testing.T) { require.Eventually(t, func() bool { return len(testEventHandler.GetEvents()) == numberWorkflows - }, 5*time.Second, time.Second) + }, tests.WaitTimeout(t), 100*time.Millisecond) for _, event := range testEventHandler.GetEvents() { assert.Equal(t, syncer.WorkflowRegisteredEvent, event.GetEventType()) @@ -380,7 +381,7 @@ func Test_SecretsWorker(t *testing.T) { lggr.Debugf("got secrets %v", secrets) require.NoError(t, err) return secrets == wantContents - }, 15*time.Second, time.Second) + }, tests.WaitTimeout(t), 100*time.Millisecond) } func Test_RegistrySyncer_WorkflowRegistered_InitiallyPaused(t *testing.T) { @@ -459,7 +460,7 @@ func Test_RegistrySyncer_WorkflowRegistered_InitiallyPaused(t *testing.T) { owner := strings.ToLower(backendTH.ContractsOwner.From.Hex()[2:]) _, err := orm.GetWorkflowSpec(ctx, owner, "test-wf") return err == nil - }, 15*time.Second, time.Second) + }, tests.WaitTimeout(t), 100*time.Millisecond) } type mockService struct{} @@ -567,7 +568,7 @@ func Test_RegistrySyncer_WorkflowRegistered_InitiallyActivated(t *testing.T) { owner := strings.ToLower(backendTH.ContractsOwner.From.Hex()[2:]) _, err = orm.GetWorkflowSpec(ctx, owner, "test-wf") return err == nil - }, 15*time.Second, time.Second) + }, tests.WaitTimeout(t), 100*time.Millisecond) } func updateAuthorizedAddress(