Skip to content

Commit

Permalink
test: Use NewTestAlways for a stream waker if the count is 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaqx0r committed Jul 10, 2024
1 parent b53a574 commit aba5e89
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/mtail/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ func TestMakeServer(tb testing.TB, patternWakers int, streamWakers int, options
tb: tb,
cancel: cancel,
}
ts.streamWaker, ts.AwakenLogStreams = waker.NewTest(ctx, streamWakers, "streams")
if streamWakers == 0 {
ts.streamWaker = waker.NewTestAlways()
ts.AwakenLogStreams = func(int, int) {}
} else {
ts.streamWaker, ts.AwakenLogStreams = waker.NewTest(ctx, streamWakers, "streams")
}
ts.patternWaker, ts.AwakenPatternPollers = waker.NewTest(ctx, patternWakers, "patterns")
options = append(options,
LogstreamPollWaker(ts.streamWaker),
Expand Down

0 comments on commit aba5e89

Please sign in to comment.