From 73bd3772d51614a5ecdb8b1c4863be16f562166c Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Tue, 27 Jun 2017 18:01:19 +0200 Subject: [PATCH] fix flaky STK test --- handshake/stk_generator_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/handshake/stk_generator_test.go b/handshake/stk_generator_test.go index cf9d53dba5f..1e38d1fa481 100644 --- a/handshake/stk_generator_test.go +++ b/handshake/stk_generator_test.go @@ -100,6 +100,8 @@ var _ = Describe("STK Generator", func() { stk, err := stkGen.DecodeToken(token) Expect(err).ToNot(HaveOccurred()) Expect(stk.RemoteAddr).To(Equal("192.168.13.37:1337")) - Expect(stk.SentTime).To(BeTemporally("~", time.Now(), time.Second)) + // the time resolution of the STK is just 1 second + // if STK generation and this check happen in "different seconds", the difference will be between 1 and 2 seconds + Expect(stk.SentTime).To(BeTemporally("~", time.Now(), 2*time.Second)) }) })