Browse Source

Merge pull request #1341 from coreos/fix_bench

raft: fix node bench
Xiang Li 11 years ago
parent
commit
00dc61d169
1 changed files with 4 additions and 4 deletions
  1. 4 4
      raft/node_bench_test.go

+ 4 - 4
raft/node_bench_test.go

@@ -3,14 +3,14 @@ package raft
 import (
 import (
 	"testing"
 	"testing"
 
 
-	"github.com/coreos/etcd/third_party/code.google.com/p/go.net/context"
+	"github.com/coreos/etcd/Godeps/_workspace/src/code.google.com/p/go.net/context"
 )
 )
 
 
 func BenchmarkOneNode(b *testing.B) {
 func BenchmarkOneNode(b *testing.B) {
 	ctx, cancel := context.WithCancel(context.Background())
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 	defer cancel()
 
 
-	n := Start(1, []int64{1}, 0, 0)
+	n := StartNode(1, []Peer{{ID: 1}}, 0, 0)
 	defer n.Stop()
 	defer n.Stop()
 
 
 	n.Campaign(ctx)
 	n.Campaign(ctx)
@@ -19,7 +19,7 @@ func BenchmarkOneNode(b *testing.B) {
 		n.Propose(ctx, []byte("foo"))
 		n.Propose(ctx, []byte("foo"))
 	}
 	}
 	rd := <-n.Ready()
 	rd := <-n.Ready()
-	if rd.HardState.Commit != int64(b.N+1) {
-		b.Errorf("commit = %d, want %d", b.N+1)
+	if rd.HardState.Commit != uint64(b.N+1) {
+		b.Errorf("commit = %d, want %d", rd.HardState.Commit, b.N+1)
 	}
 	}
 }
 }