Skip to content

Instantly share code, notes, and snippets.

@hsinhoyeh
Created July 27, 2014 16:36
Show Gist options
  • Save hsinhoyeh/8d497dfa8fd8a24b6afd to your computer and use it in GitHub Desktop.
Save hsinhoyeh/8d497dfa8fd8a24b6afd to your computer and use it in GitHub Desktop.
diff --git a/netchan_test.go b/netchan_test.go
index 44a73cc..c915c1a 100644
--- a/netchan_test.go
+++ b/netchan_test.go
@@ -99,6 +99,8 @@ func TestRecvChanAsyncLeakGoRoutines(t *testing.T) {
ec.Publish("foo", 22)
ec.Flush()
+ time.Sleep(50 * time.Millisecond)
+
after := runtime.NumGoroutine()
if before != after {
@@ -149,6 +151,7 @@ func TestRecvChanMultipleMessages(t *testing.T) {
ec.Publish("foo", 22)
}
ec.Flush()
+ time.Sleep(50 * time.Millisecond)
if lch := len(ch); lch != size {
t.Fatalf("Expected %d messages queued, got %d.", size, lch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment