diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2018-06-08 13:29:31 +0300 |
---|---|---|
committer | Kim Carlbäcker <kim.carlbacker@gmail.com> | 2018-06-08 13:29:31 +0300 |
commit | a09d49bc9262c76eb3edcd1b71950d79b79d9199 (patch) | |
tree | b1acb5dec578035ecf3536587898b737bc97d1b2 | |
parent | 37c41ef09793cdba5e7b5f12b735c376d68dba3e (diff) |
Try to fix flaky rubyserver.TestRemovals test
-rw-r--r-- | changelogs/unreleased/rubyserver-sleep-0.yml | 5 | ||||
-rw-r--r-- | internal/rubyserver/balancer/balancer_test.go | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/changelogs/unreleased/rubyserver-sleep-0.yml b/changelogs/unreleased/rubyserver-sleep-0.yml new file mode 100644 index 000000000..9f24abeb2 --- /dev/null +++ b/changelogs/unreleased/rubyserver-sleep-0.yml @@ -0,0 +1,5 @@ +--- +title: Try to fix flaky rubyserver.TestRemovals test +merge_request: 759 +author: +type: other diff --git a/internal/rubyserver/balancer/balancer_test.go b/internal/rubyserver/balancer/balancer_test.go index 637b1d8f2..8fdcb0a09 100644 --- a/internal/rubyserver/balancer/balancer_test.go +++ b/internal/rubyserver/balancer/balancer_test.go @@ -156,7 +156,12 @@ func TestRemovals(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { lbBuilder.testingRestart <- struct{}{} - time.Sleep(2 * removeDelay) // wait for lastRemoval in monitor goroutine to be long enough ago + bootSleep := 2 * removeDelay + if bootSleep == 0 { + bootSleep = 2 * time.Millisecond + } + + time.Sleep(bootSleep) // wait for lastRemoval in monitor goroutine to be long enough ago for i, a := range tc.actions { if a.add != "" { |