tests: relax index checks

TestStateStore_Indexes specifically tests for `nodes` index, but asserts
on the exact number of indexes present in the state.  This is fragile
and will break almost everytime we add a state index.
This commit is contained in:
Mahmood Ali 2020-03-25 08:29:25 -04:00
parent 884d18f068
commit 281fc9837c

View file

@ -10,6 +10,7 @@ import (
"time"
"github.com/hashicorp/go-memdb"
"github.com/kr/pretty"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -3137,8 +3138,8 @@ func TestStateStore_Indexes(t *testing.T) {
}
expect := &IndexEntry{"nodes", 1000}
if l := len(out); l != 1 && l != 2 {
t.Fatalf("unexpected number of index entries: %v", out)
if l := len(out); l < 1 {
t.Fatalf("unexpected number of index entries: %v", pretty.Sprint(out))
}
for _, index := range out {