From f05926dd62535d230a167d0fc5c9cc10e8289883 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 2 Mar 2018 14:53:05 -0500 Subject: [PATCH] 12552: Fix starvation in test case. refs #12552 Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- services/crunch-dispatch-slurm/squeue_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/crunch-dispatch-slurm/squeue_test.go b/services/crunch-dispatch-slurm/squeue_test.go index f1ffda9d86..694a4d6f36 100644 --- a/services/crunch-dispatch-slurm/squeue_test.go +++ b/services/crunch-dispatch-slurm/squeue_test.go @@ -99,6 +99,14 @@ func (s *SqueueSuite) TestSetPriorityBeforeQueued(c *C) { case <-tick.C: slurm.queue = uuidGood + " 0 12345\n" sqc.check() + + // Avoid immediately selecting this case again + // on the next iteration if check() took + // longer than one tick. + select { + case <-tick.C: + default: + } case <-timeout.C: c.Fatal("timed out") case <-done: -- 2.30.2