mirror of https://github.com/status-im/consul.git
Took out usage of snapshot SessionListTTL
This commit is contained in:
parent
0f9723e6f8
commit
60915629f6
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue