|
|
@ -19,8 +19,10 @@ func TestInitializeSessionTimers(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
testutil.WaitForLeader(t, s1.RPC, "dc1")
|
|
|
|
testutil.WaitForLeader(t, s1.RPC, "dc1")
|
|
|
|
|
|
|
|
|
|
|
|
state := s1.fsm.State()
|
|
|
|
state := s1.fsm.StateNew()
|
|
|
|
state.EnsureNode(1, structs.Node{Node: "foo", Address: "127.0.0.1"})
|
|
|
|
if err := state.EnsureNode(1, &structs.Node{Node: "foo", Address: "127.0.0.1"}); err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
session := &structs.Session{
|
|
|
|
session := &structs.Session{
|
|
|
|
ID: generateUUID(),
|
|
|
|
ID: generateUUID(),
|
|
|
|
Node: "foo",
|
|
|
|
Node: "foo",
|
|
|
@ -57,8 +59,10 @@ func TestResetSessionTimer_Fault(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Create a session
|
|
|
|
// Create a session
|
|
|
|
state := s1.fsm.State()
|
|
|
|
state := s1.fsm.StateNew()
|
|
|
|
state.EnsureNode(1, structs.Node{Node: "foo", Address: "127.0.0.1"})
|
|
|
|
if err := state.EnsureNode(1, &structs.Node{Node: "foo", Address: "127.0.0.1"}); err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
session := &structs.Session{
|
|
|
|
session := &structs.Session{
|
|
|
|
ID: generateUUID(),
|
|
|
|
ID: generateUUID(),
|
|
|
|
Node: "foo",
|
|
|
|
Node: "foo",
|
|
|
@ -89,8 +93,10 @@ func TestResetSessionTimer_NoTTL(t *testing.T) {
|
|
|
|
testutil.WaitForLeader(t, s1.RPC, "dc1")
|
|
|
|
testutil.WaitForLeader(t, s1.RPC, "dc1")
|
|
|
|
|
|
|
|
|
|
|
|
// Create a session
|
|
|
|
// Create a session
|
|
|
|
state := s1.fsm.State()
|
|
|
|
state := s1.fsm.StateNew()
|
|
|
|
state.EnsureNode(1, structs.Node{Node: "foo", Address: "127.0.0.1"})
|
|
|
|
if err := state.EnsureNode(1, &structs.Node{Node: "foo", Address: "127.0.0.1"}); err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
session := &structs.Session{
|
|
|
|
session := &structs.Session{
|
|
|
|
ID: generateUUID(),
|
|
|
|
ID: generateUUID(),
|
|
|
|
Node: "foo",
|
|
|
|
Node: "foo",
|
|
|
@ -200,8 +206,10 @@ func TestInvalidateSession(t *testing.T) {
|
|
|
|
testutil.WaitForLeader(t, s1.RPC, "dc1")
|
|
|
|
testutil.WaitForLeader(t, s1.RPC, "dc1")
|
|
|
|
|
|
|
|
|
|
|
|
// Create a session
|
|
|
|
// Create a session
|
|
|
|
state := s1.fsm.State()
|
|
|
|
state := s1.fsm.StateNew()
|
|
|
|
state.EnsureNode(1, structs.Node{Node: "foo", Address: "127.0.0.1"})
|
|
|
|
if err := state.EnsureNode(1, &structs.Node{Node: "foo", Address: "127.0.0.1"}); err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
session := &structs.Session{
|
|
|
|
session := &structs.Session{
|
|
|
|
ID: generateUUID(),
|
|
|
|
ID: generateUUID(),
|
|
|
|
Node: "foo",
|
|
|
|
Node: "foo",
|
|
|
|