From 67503f9d413ec92cb1ea6627604022ac08f0bbc4 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 5 Mar 2021 11:55:36 +0800 Subject: [PATCH] fix flaky accept queue integration test --- integrationtests/self/handshake_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/integrationtests/self/handshake_test.go b/integrationtests/self/handshake_test.go index 5bd596551..ace1504ef 100644 --- a/integrationtests/self/handshake_test.go +++ b/integrationtests/self/handshake_test.go @@ -340,7 +340,7 @@ var _ = Describe("Handshake tests", func() { Expect(err).ToNot(HaveOccurred()) defer sess.CloseWithError(0, "") } - time.Sleep(25 * time.Millisecond) // wait a bit for the sessions to be queued + time.Sleep(scaleDuration(20 * time.Millisecond)) // wait a bit for the sessions to be queued _, err = dial() Expect(err).To(HaveOccurred()) @@ -349,12 +349,13 @@ var _ = Describe("Handshake tests", func() { // Now close the one of the session that are waiting to be accepted. // This should free one spot in the queue. Expect(firstSess.CloseWithError(0, "")) - time.Sleep(25 * time.Millisecond) + Eventually(firstSess.Context().Done()).Should(BeClosed()) + time.Sleep(scaleDuration(20 * time.Millisecond)) // dial again, and expect that this dial succeeds _, err = dial() Expect(err).ToNot(HaveOccurred()) - time.Sleep(25 * time.Millisecond) // wait a bit for the session to be queued + time.Sleep(scaleDuration(20 * time.Millisecond)) // wait a bit for the session to be queued _, err = dial() Expect(err).To(HaveOccurred())