Skip to content

Commit

Permalink
chore: increase timeouts in workflow_syncer_test (#15818)
Browse files Browse the repository at this point in the history
* chore: increase timeouts in workflow_syncer_test

* fix: lower check interval to 1s
  • Loading branch information
erikburt authored Jan 3, 2025
1 parent 42d02c2 commit b7ced6e
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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), time.Second)

for _, event := range testEventHandler.GetEvents() {
assert.Equal(t, syncer.WorkflowRegisteredEvent, event.GetEventType())
Expand Down Expand Up @@ -216,7 +217,7 @@ func Test_EventHandlerStateSync(t *testing.T) {
}

return false
}, 50*time.Second, time.Second)
}, tests.WaitTimeout(t), time.Second)
}

func Test_InitialStateSync(t *testing.T) {
Expand Down Expand Up @@ -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), time.Second)

for _, event := range testEventHandler.GetEvents() {
assert.Equal(t, syncer.WorkflowRegisteredEvent, event.GetEventType())
Expand Down Expand Up @@ -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), time.Second)
}

func Test_RegistrySyncer_WorkflowRegistered_InitiallyPaused(t *testing.T) {
Expand Down Expand Up @@ -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), time.Second)
}

type mockService struct{}
Expand Down Expand Up @@ -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), time.Second)
}

func updateAuthorizedAddress(
Expand Down

0 comments on commit b7ced6e

Please sign in to comment.