142
}
143
144
>
func (h HistoryRequire) WaitForHistoryEvents(expectedHistory string, actualHistoryEventsReader HistoryEventsReader, waitFor time.Duration, tick time.Duration) {
history_require.go
145
>
if th, ok := h.t.(helper); ok {
146
>
th.Helper()
147
>
}
148
149
>
expectedHistoryEvents, expectedEventsAttributes := h.parseHistory(expectedHistory)
history_require.go
150
>
151
>
var actualHistoryEvents []*historypb.HistoryEvent
152
>
require.EventuallyWithT(h.t, func(t *assert.CollectT) {
153
>
actualHistoryEvents = actualHistoryEventsReader()
154
>
require.Lenf(t, actualHistoryEvents, len(expectedHistoryEvents),
155
>
"Length of expected(%d) and actual(%d) histories is not equal - actual history: \n%v",
156
>
len(expectedHistoryEvents), len(actualHistoryEvents), h.formatHistoryEvents(actualHistoryEvents, true))
157
>
}, waitFor, tick)
158
159
>
h.equalHistoryEvents(expectedHistoryEvents, expectedEventsAttributes, actualHistoryEvents)
history_require.go
160
}
161