diff --git a/profiler/profiler_test.go b/profiler/profiler_test.go index bbc0d9b519..9ca0781687 100644 --- a/profiler/profiler_test.go +++ b/profiler/profiler_test.go @@ -202,14 +202,12 @@ func TestProfilerPassthrough(t *testing.T) { } p.run() var bat batch -loop: - for { - select { - case bat = <-p.out: - break loop - case <-time.After(500 * time.Millisecond): - t.Fatal("time expired") - } + select { + case bat = <-out: + // TODO (knusbaum) this timeout is long because we were seeing timeouts at 500ms. + // it would be nice to have a time-independent way to test this + case <-time.After(1000 * time.Millisecond): + t.Fatal("time expired") } assert.Equal(t, 2, len(bat.profiles))