From af90ecdddfa118f0d03643419713a5330b03ec9c Mon Sep 17 00:00:00 2001 From: John Gardiner Myers Date: Fri, 22 May 2020 19:26:42 -0700 Subject: [PATCH] Reduce test flakiness --- pkg/instancegroups/rollingupdate_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/instancegroups/rollingupdate_test.go b/pkg/instancegroups/rollingupdate_test.go index db7f6fd8296f3..53ab1637981cc 100644 --- a/pkg/instancegroups/rollingupdate_test.go +++ b/pkg/instancegroups/rollingupdate_test.go @@ -979,8 +979,10 @@ func (c *concurrentTest) TerminateInstances(input *ec2.TerminateInstancesInput) return c.EC2API.TerminateInstances(input) } +const postTerminationValidationDelay = 100 * time.Millisecond // NodeInterval plus some + func (c *concurrentTest) delayThenWakeValidation() { - time.Sleep(20 * time.Millisecond) // NodeInterval plus some + time.Sleep(postTerminationValidationDelay) select { case c.validationChan <- true: default: @@ -1245,7 +1247,7 @@ func (t *alreadyDetachedTest) Validate() (*validation.ValidationCluster, error) assert.Equal(t.t, t.numValidations, len(t.detached), "numnber of detached instances") case 4: t.mutex.Unlock() - time.Sleep(20 * time.Millisecond) // NodeInterval plus some + time.Sleep(postTerminationValidationDelay) t.mutex.Lock() assert.Equal(t.t, 1, t.terminationRequestsLeft, "terminations left") case 5: