From 44353821e6bf99839dac15f0049a3335c0376258 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Fri, 24 Apr 2020 14:04:36 +0300 Subject: [PATCH] * TestAuth: improve test --- home/auth_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/auth_test.go b/home/auth_test.go index 38f826ec..a4829b93 100644 --- a/home/auth_test.go +++ b/home/auth_test.go @@ -47,7 +47,7 @@ func TestAuth(t *testing.T) { // add session with TTL = 2 sec s = session{} - s.expire = uint32(now + 2) + s.expire = uint32(time.Now().UTC().Unix() + 2) a.addSession(sess, &s) assert.True(t, a.CheckSession(sessStr) == 0) @@ -59,7 +59,7 @@ func TestAuth(t *testing.T) { // the session is still alive assert.True(t, a.CheckSession(sessStr) == 0) // reset our expiration time because CheckSession() has just updated it - s.expire = uint32(now + 2) + s.expire = uint32(time.Now().UTC().Unix() + 2) a.storeSession(sess, &s) a.Close()