From 404b332e6aee57dbdde9493980425b39e5b11543 Mon Sep 17 00:00:00 2001 From: kaiyou Date: Thu, 14 May 2020 12:09:14 +0200 Subject: [PATCH] Fix the state tests using custom statePath --- cluster/state_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/state_test.go b/cluster/state_test.go index cdbb24f..c5e0944 100644 --- a/cluster/state_test.go +++ b/cluster/state_test.go @@ -9,7 +9,7 @@ import ( ) func Test_state_save_soad(t *testing.T) { - statePath = "/tmp/wesher.json" + statePath := "/tmp/wesher.json" key := "abcdefghijklmnopqrstuvwxyzABCDEF" node := common.Node{ Name: "node", @@ -23,11 +23,11 @@ func Test_state_save_soad(t *testing.T) { }, } - if err := cluster.state.save(); err != nil { + if err := cluster.state.save(statePath); err != nil { t.Error(err) } loaded := &state{} - loadState(loaded) + loadState(loaded, statePath) if !reflect.DeepEqual(cluster.state, loaded) { t.Errorf("cluster state save then reload mistmatch: %s / %s", cluster.state, loaded)