Took out usage of snapshot SessionListTTL

This commit is contained in:
Atin Malaviya 2014-12-10 21:37:06 -05:00
parent 0f9723e6f8
commit 60915629f6
2 changed files with 8 additions and 10 deletions

View File

@ -239,7 +239,7 @@ func TestSessionTTL(t *testing.T) {
t.Fatalf("Incorrect TTL: %s", respObj[0].TTL) t.Fatalf("Incorrect TTL: %s", respObj[0].TTL)
} }
time.Sleep(ttl * structs.SessionTTLMultiplier + ttl) time.Sleep(ttl*structs.SessionTTLMultiplier + ttl)
req, err = http.NewRequest("GET", req, err = http.NewRequest("GET",
"/v1/session/info/"+id, nil) "/v1/session/info/"+id, nil)

View File

@ -798,16 +798,14 @@ func TestStoreSnapshot(t *testing.T) {
t.Fatalf("missing sessions") t.Fatalf("missing sessions")
} }
// Check there is 1 session with TTL ttls := 0
sessions, err = snap.SessionListTTL() for _, session := range sessions {
if err != nil { if session.TTL != "" {
t.Fatalf("err: %v", err) ttls++
}
} }
if ttls != 1 {
if len(sessions) < 1 { t.Fatalf("Wrong number of sessions with TTL")
t.Fatalf("missing TTL session")
} else if len(sessions) > 1 {
t.Fatalf("too many TTL sessions")
} }
// Check for an acl // Check for an acl