Codebase list golang-github-go-kit-kit / 2cf07ee
Fix flaky Travis test? Peter Bourgon 8 years ago
1 changed file(s) with 9 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
8585 ch <- time.Now() // signal flush
8686 runtime.Gosched() // yield to flush
8787
88 // Travis is annoying
89 deadline := time.Now().Add(100 * time.Millisecond)
90 for buf.String() == "" {
91 if time.Now().After(deadline) {
92 t.Fatal("buffer never got write + flush")
93 }
94 time.Sleep(time.Millisecond)
95 }
96
8897 if want, have := fmt.Sprintf("test_statsd_callback_gauge:%f|g\n", value), buf.String(); want != have {
8998 t.Errorf("want %q, have %q", want, have)
9099 }