Skip to content

Commit 097167a

Browse files
committed
Add heartbeat implementation to test writer
1 parent 3d93511 commit 097167a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

v2/pkg/engine/resolve/event_loop_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ func (f *FakeSubscriptionWriter) Complete() {
5151
f.messageCountOnComplete = len(f.writtenMessages)
5252
}
5353

54+
// Heartbeat writes directly to the writtenMessages slice, as the real implementations implicitly flush
5455
func (f *FakeSubscriptionWriter) Heartbeat() error {
56+
f.mu.Lock()
57+
defer f.mu.Unlock()
58+
f.writtenMessages = append(f.writtenMessages, string("heartbeat"))
5559
return nil
5660
}
5761

v2/pkg/engine/resolve/resolve_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4778,6 +4778,9 @@ func (s *SubscriptionRecorder) Complete() {
47784778
}
47794779

47804780
func (s *SubscriptionRecorder) Heartbeat() error {
4781+
s.mux.Lock()
4782+
defer s.mux.Unlock()
4783+
s.messages = append(s.messages, "heartbeat")
47814784
return nil
47824785
}
47834786

0 commit comments

Comments
 (0)