|
|
|
@ -76,9 +76,12 @@ func Test_MultiNodeSimple(t *testing.T) {
|
|
|
|
|
t.Fatalf("wrong leader commit index, got: %d, exp: %d", got, exp)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := s0.WaitCommitIndex(time.Second); err != nil {
|
|
|
|
|
if err := s0.WaitForCommitIndex(4, time.Second); err != nil {
|
|
|
|
|
t.Fatalf("failed to wait for commit index: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
if err := s0.WaitForCommitIndex(5, 500*time.Millisecond); err == nil {
|
|
|
|
|
t.Fatalf("unexpectedly waited successfully for commit index")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Now, do a NONE consistency query on each node, to actually confirm the data
|
|
|
|
|
// has been replicated.
|
|
|
|
@ -112,9 +115,12 @@ func Test_MultiNodeSimple(t *testing.T) {
|
|
|
|
|
t.Fatalf("wrong leader commit index, got: %d, exp: %d", got, exp)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := s1.WaitCommitIndex(time.Second); err != nil {
|
|
|
|
|
if err := s1.WaitForCommitIndex(4, time.Second); err != nil {
|
|
|
|
|
t.Fatalf("failed to wait for commit index: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
if err := s1.WaitForCommitIndex(5, 500*time.Millisecond); err == nil {
|
|
|
|
|
t.Fatalf("unexpectedly waited successfully for commit index")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Write another row using Request
|
|
|
|
|
rr := executeQueryRequestFromString("INSERT INTO foo(id, name) VALUES(2, 'fiona')", proto.QueryRequest_QUERY_REQUEST_LEVEL_STRONG, false, false)
|
|
|
|
|