Skip to content

Commit 8e7a004

Browse files
remove sleep for 31 seconds. reduce time interval for testing (#197)
1 parent 098c7fa commit 8e7a004

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/event/processor_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ func TestDefaultEventProcessor_LogEventNotification(t *testing.T) {
123123
func TestDefaultEventProcessor_DefaultConfig(t *testing.T) {
124124
exeCtx := utils.NewCancelableExecutionCtx()
125125
processor := NewBatchEventProcessor(
126-
WithEventDispatcher(NewMockDispatcher(100, false)))
126+
WithEventDispatcher(NewMockDispatcher(100, false)),
127+
// here we are setting the timing interval so that we don't have to wait the default 30 seconds
128+
WithFlushInterval(500 * time.Millisecond))
127129
processor.Start(exeCtx)
128130

129131
impression := BuildTestImpressionEvent()
@@ -136,7 +138,8 @@ func TestDefaultEventProcessor_DefaultConfig(t *testing.T) {
136138

137139
assert.Equal(t, 4, processor.EventsCount())
138140

139-
time.Sleep(31 * time.Second)
141+
// sleep for 1 second here. to allow event processor to run.
142+
time.Sleep(1 * time.Second)
140143

141144
assert.NotNil(t, processor.Ticker)
142145

0 commit comments

Comments
 (0)