Skip to content

Commit

Permalink
fix flaky STK test
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Jun 27, 2017
1 parent 1c1d7cc commit 73bd377
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion handshake/stk_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})
})

0 comments on commit 73bd377

Please sign in to comment.