From 27157e5e784616197dd966e3e5aefa8e9b38f45b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Sat, 9 Nov 2013 21:17:32 -0800 Subject: [PATCH] fix tests --- .../multi_node_kill_all_and_recovery_test.go | 5 ++--- tests/functional/simple_snapshot_test.go | 13 +++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/functional/multi_node_kill_all_and_recovery_test.go b/tests/functional/multi_node_kill_all_and_recovery_test.go index 454b9648c..4f3c0e795 100644 --- a/tests/functional/multi_node_kill_all_and_recovery_test.go +++ b/tests/functional/multi_node_kill_all_and_recovery_test.go @@ -65,8 +65,7 @@ func TestMultiNodeKillAllAndRecovery(t *testing.T) { t.Fatalf("Recovery error: %s", err) } - if result.Index != 18 { - t.Fatalf("recovery failed! [%d/18]", result.Index) + if result.Index != 16 { + t.Fatalf("recovery failed! [%d/16]", result.Index) } } - diff --git a/tests/functional/simple_snapshot_test.go b/tests/functional/simple_snapshot_test.go index e7cce08cc..e6f8d7729 100644 --- a/tests/functional/simple_snapshot_test.go +++ b/tests/functional/simple_snapshot_test.go @@ -3,6 +3,7 @@ package test import ( "io/ioutil" "os" + "strconv" "testing" "time" @@ -52,8 +53,10 @@ func TestSimpleSnapshot(t *testing.T) { t.Fatal("wrong number of snapshot :[1/", len(snapshots), "]") } - if snapshots[0].Name() != "0_503.ss" { - t.Fatal("wrong name of snapshot :[0_503.ss/", snapshots[0].Name(), "]") + index, _ := strconv.Atoi(snapshots[0].Name()[2:5]) + + if index < 507 || index > 510 { + t.Fatal("wrong name of snapshot :", snapshots[0].Name()) } // issue second 501 commands @@ -82,7 +85,9 @@ func TestSimpleSnapshot(t *testing.T) { t.Fatal("wrong number of snapshot :[1/", len(snapshots), "]") } - if snapshots[0].Name() != "0_1004.ss" { - t.Fatal("wrong name of snapshot :[0_1004.ss/", snapshots[0].Name(), "]") + index, _ = strconv.Atoi(snapshots[0].Name()[2:6]) + + if index < 1015 || index > 1018 { + t.Fatal("wrong name of snapshot :", snapshots[0].Name()) } }