Add buffer to mockPublisher channel to prevent deadlock between Publish() and Stop()

This commit is contained in:
Tom Wilkie
2016-04-20 16:18:16 +01:00
parent b85e287a22
commit 919d813b70

View File

@@ -96,7 +96,7 @@ func TestProbe(t *testing.T) {
LastSeen: now,
}
pub := mockPublisher{make(chan report.Report)}
pub := mockPublisher{make(chan report.Report, 10)}
p := New(probeID, 10*time.Millisecond, 100*time.Millisecond, pub)
p.AddReporter(mockReporter{want})