don't run commands against holder before messing with its stats

You have to start the cluster before you can refer to its holders,
because GetNode doesn't work on an unstarted cluster, but if you
actually issue any commands, those require messing with the worker
pool which wants to have access to the holder's stats.
This commit is contained in:
Seebs 2022-09-07 11:19:21 -05:00 committed by Kasey Rodgers
parent 01a0eb0d74
commit 3671129cd5

View file

@ -117,9 +117,6 @@ func TestStatsCount_Bitmap(t *testing.T) {
c := test.MustRunUnsharedCluster(t, 1)
defer c.Close()
hldr := test.Holder{Holder: c.GetNode(0).Server.Holder()}
hldr.SetBit("d", "f", 0, 0)
hldr.SetBit("d", "f", 0, 1)
called := false
hldr.Holder.Stats = &MockStats{
mockCountWithTags: func(name string, value int64, rate float64, tags []string) {
@ -134,6 +131,10 @@ func TestStatsCount_Bitmap(t *testing.T) {
called = true
},
}
hldr.SetBit("d", "f", 0, 0)
hldr.SetBit("d", "f", 0, 1)
if _, err := c.GetNode(0).API.Query(context.Background(), &pilosa.QueryRequest{Index: "d", Query: `Row(f=0)`}); err != nil {
t.Fatal(err)
}