|
@@ -391,7 +391,7 @@ func testServer(t *testing.T, ns int64) {
|
|
|
|
|
|
|
|
for i := int64(0); i < ns; i++ {
|
|
for i := int64(0); i < ns; i++ {
|
|
|
id := i + 1
|
|
id := i + 1
|
|
|
- n := raft.StartNode(id, members, 10, 1)
|
|
|
|
|
|
|
+ n := raft.StartNode(id, members, 10, 1, nil)
|
|
|
tk := time.NewTicker(10 * time.Millisecond)
|
|
tk := time.NewTicker(10 * time.Millisecond)
|
|
|
defer tk.Stop()
|
|
defer tk.Stop()
|
|
|
srv := &EtcdServer{
|
|
srv := &EtcdServer{
|
|
@@ -458,7 +458,7 @@ func TestDoProposal(t *testing.T) {
|
|
|
|
|
|
|
|
for i, tt := range tests {
|
|
for i, tt := range tests {
|
|
|
ctx, _ := context.WithCancel(context.Background())
|
|
ctx, _ := context.WithCancel(context.Background())
|
|
|
- n := raft.StartNode(0xBAD0, []int64{0xBAD0}, 10, 1)
|
|
|
|
|
|
|
+ n := raft.StartNode(0xBAD0, []int64{0xBAD0}, 10, 1, nil)
|
|
|
st := &storeRecorder{}
|
|
st := &storeRecorder{}
|
|
|
tk := make(chan time.Time)
|
|
tk := make(chan time.Time)
|
|
|
// this makes <-tk always successful, which accelerates internal clock
|
|
// this makes <-tk always successful, which accelerates internal clock
|
|
@@ -491,7 +491,7 @@ func TestDoProposal(t *testing.T) {
|
|
|
func TestDoProposalCancelled(t *testing.T) {
|
|
func TestDoProposalCancelled(t *testing.T) {
|
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
|
// node cannot make any progress because there are two nodes
|
|
// node cannot make any progress because there are two nodes
|
|
|
- n := raft.StartNode(0xBAD0, []int64{0xBAD0, 0xBAD1}, 10, 1)
|
|
|
|
|
|
|
+ n := raft.StartNode(0xBAD0, []int64{0xBAD0, 0xBAD1}, 10, 1, nil)
|
|
|
st := &storeRecorder{}
|
|
st := &storeRecorder{}
|
|
|
wait := &waitRecorder{}
|
|
wait := &waitRecorder{}
|
|
|
srv := &EtcdServer{
|
|
srv := &EtcdServer{
|
|
@@ -527,7 +527,7 @@ func TestDoProposalStopped(t *testing.T) {
|
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
|
defer cancel()
|
|
defer cancel()
|
|
|
// node cannot make any progress because there are two nodes
|
|
// node cannot make any progress because there are two nodes
|
|
|
- n := raft.StartNode(0xBAD0, []int64{0xBAD0, 0xBAD1}, 10, 1)
|
|
|
|
|
|
|
+ n := raft.StartNode(0xBAD0, []int64{0xBAD0, 0xBAD1}, 10, 1, nil)
|
|
|
st := &storeRecorder{}
|
|
st := &storeRecorder{}
|
|
|
tk := make(chan time.Time)
|
|
tk := make(chan time.Time)
|
|
|
// this makes <-tk always successful, which accelarates internal clock
|
|
// this makes <-tk always successful, which accelarates internal clock
|
|
@@ -668,7 +668,7 @@ func TestSyncTrigger(t *testing.T) {
|
|
|
// snapshot should snapshot the store and cut the persistent
|
|
// snapshot should snapshot the store and cut the persistent
|
|
|
// TODO: node.Compact is called... we need to make the node an interface
|
|
// TODO: node.Compact is called... we need to make the node an interface
|
|
|
func TestSnapshot(t *testing.T) {
|
|
func TestSnapshot(t *testing.T) {
|
|
|
- n := raft.StartNode(0xBAD0, []int64{0xBAD0}, 10, 1)
|
|
|
|
|
|
|
+ n := raft.StartNode(0xBAD0, []int64{0xBAD0}, 10, 1, nil)
|
|
|
defer n.Stop()
|
|
defer n.Stop()
|
|
|
st := &storeRecorder{}
|
|
st := &storeRecorder{}
|
|
|
p := &storageRecorder{}
|
|
p := &storageRecorder{}
|
|
@@ -699,7 +699,7 @@ func TestSnapshot(t *testing.T) {
|
|
|
// Applied > SnapCount should trigger a SaveSnap event
|
|
// Applied > SnapCount should trigger a SaveSnap event
|
|
|
func TestTriggerSnap(t *testing.T) {
|
|
func TestTriggerSnap(t *testing.T) {
|
|
|
ctx := context.Background()
|
|
ctx := context.Background()
|
|
|
- n := raft.StartNode(0xBAD0, []int64{0xBAD0}, 10, 1)
|
|
|
|
|
|
|
+ n := raft.StartNode(0xBAD0, []int64{0xBAD0}, 10, 1, nil)
|
|
|
n.Campaign(ctx)
|
|
n.Campaign(ctx)
|
|
|
st := &storeRecorder{}
|
|
st := &storeRecorder{}
|
|
|
p := &storageRecorder{}
|
|
p := &storageRecorder{}
|