Merge pull request #2649 from hashicorp/test-fix

Fix inconsistency in TestStateStore_ServicesByNodeMeta
This commit is contained in:
Kyle Havlovitz 2017-01-12 19:59:21 -05:00 committed by GitHub
commit 379d5492c4
1 changed files with 3 additions and 3 deletions

View File

@ -1204,8 +1204,9 @@ func TestStateStore_ServicesByNodeMeta(t *testing.T) {
t.Fatalf("bad index: %d", idx) t.Fatalf("bad index: %d", idx)
} }
expected := structs.Services{ expected := structs.Services{
"redis": []string{"prod", "master"}, "redis": []string{"master", "prod"},
} }
sort.Strings(res["redis"])
if !reflect.DeepEqual(res, expected) { if !reflect.DeepEqual(res, expected) {
t.Fatalf("bad: %v %v", res, expected) t.Fatalf("bad: %v %v", res, expected)
} }
@ -1219,10 +1220,9 @@ func TestStateStore_ServicesByNodeMeta(t *testing.T) {
t.Fatalf("bad index: %d", idx) t.Fatalf("bad index: %d", idx)
} }
expected = structs.Services{ expected = structs.Services{
"redis": []string{"prod", "master", "slave"}, "redis": []string{"master", "prod", "slave"},
} }
sort.Strings(res["redis"]) sort.Strings(res["redis"])
sort.Strings(expected["redis"])
if !reflect.DeepEqual(res, expected) { if !reflect.DeepEqual(res, expected) {
t.Fatalf("bad: %v %v", res, expected) t.Fatalf("bad: %v %v", res, expected)
} }