diff --git a/submission/queue_test.go b/submission/queue_test.go index 02b841e6ac0a3987954e8a0cad6c1c4f48b06d32..d80c10b93a4997f3373b1ffdbfa2efa32d084a72 100644 --- a/submission/queue_test.go +++ b/submission/queue_test.go @@ -56,7 +56,7 @@ func rateDo(timeout time.Duration, qps float64, f func()) int { } func runTest(t *testing.T, tag string, opts *Options, qps float64) (int, int) { - //t.Parallel() + t.Parallel() fc := new(fakeClient) if opts == nil { @@ -64,7 +64,6 @@ func runTest(t *testing.T, tag string, opts *Options, qps float64) (int, int) { } opts.MaxDelay = 1 * time.Second s := newSubmitter(fc, opts) - defer s.Close() n := rateDo(3*time.Second, qps, func() { s.AddEvent(&ippb.Event{ @@ -73,7 +72,8 @@ func runTest(t *testing.T, tag string, opts *Options, qps float64) (int, int) { Count: 1, }) }) - time.Sleep(1 * time.Second) + + s.Close() if fc.rcvd != n { t.Fatalf("%s: mismatch between events sent (%d) and received (%d)", tag, n, fc.rcvd)