Skip to content

Commit 4541c22

Browse files
committed
event/filter: hack around data race in the test
1 parent d652a58 commit 4541c22

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

event/filter/filter_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package filter
22

3-
import "testing"
3+
import (
4+
"testing"
5+
"time"
6+
)
47

58
func TestFilters(t *testing.T) {
69
var success bool
@@ -24,6 +27,8 @@ func TestFilters(t *testing.T) {
2427
fm.Notify(Generic{Str1: "hello"}, true)
2528
fm.Stop()
2629

30+
time.Sleep(10 * time.Millisecond) // yield to the notifier
31+
2732
if !success {
2833
t.Error("expected 'hello' to be posted")
2934
}

0 commit comments

Comments
 (0)