From 64b4935b18fcc357e174063615f9d85bce187e08 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Mon, 19 Apr 2021 09:10:27 +0100 Subject: [PATCH] Make queue tests run in parallel --- submission/queue_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/submission/queue_test.go b/submission/queue_test.go index 02b841e..d80c10b 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) -- GitLab