Commit 64b4935b authored by ale's avatar ale
Browse files

Make queue tests run in parallel

parent 2267db72
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment