Skip to content

Commit 0bbf123

Browse files
Address flakey dispatcher flush test (#2593)
Allow the dispatcher to be called multiple times in a flakey test case. Ensure that is called at least once by the periodic timer.
1 parent 41f6ea0 commit 0bbf123

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/pkg/agent/application/managed_mode_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ func Test_runDispatcher(t *testing.T) {
102102
},
103103
interval: time.Second,
104104
}, {
105-
name: "no gateway actions, dispatcher is flushed",
106-
skipOnWindowsReason: "Flaky test: https://github.com/elastic/elastic-agent/issues/2585",
105+
name: "no gateway actions, dispatcher is flushed",
107106
mockGateway: func(ch chan []fleetapi.Action) *mockGateway {
108107
gateway := &mockGateway{}
109108
gateway.On("Actions").Return((<-chan []fleetapi.Action)(ch))
@@ -112,6 +111,7 @@ func Test_runDispatcher(t *testing.T) {
112111
mockDispatcher: func() *mockDispatcher {
113112
dispatcher := &mockDispatcher{}
114113
dispatcher.On("Dispatch", mock.Anything, mock.Anything, mock.Anything).Once()
114+
dispatcher.On("Dispatch", mock.Anything, mock.Anything, mock.Anything).Maybe() // allow a second call in case there are timing issues in the CI pipeline
115115
return dispatcher
116116
},
117117
interval: time.Millisecond * 60,

0 commit comments

Comments
 (0)