From 073020f6beb27f1e94664157360f71b8ca90f5ee Mon Sep 17 00:00:00 2001 From: Atin Malaviya Date: Thu, 11 Dec 2014 06:09:53 -0500 Subject: [PATCH] Add invalidateSession test --- consul/session_ttl_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/consul/session_ttl_test.go b/consul/session_ttl_test.go index e4db812e3..d26264f03 100644 --- a/consul/session_ttl_test.go +++ b/consul/session_ttl_test.go @@ -148,12 +148,8 @@ func TestServer_sessionTTL(t *testing.T) { t.Fatalf("sessionTimes length should be 2") } - // destroy the id1 session (test clearSessionTimer) - arg.Op = structs.SessionDestroy - arg.Session.ID = id1 - if err := client.Call("Session.Apply", &arg, &id1); err != nil { - t.Fatalf("err: %v", err) - } + // destroy the via invalidateSession as if on TTL expiry + leader.invalidateSession(id2) if len(leader.sessionTimers) != 1 { t.Fatalf("sessionTimers length should 1")