From 3671129cd5864a0c6d7fcf21a2a7d6b4cbe433f5 Mon Sep 17 00:00:00 2001 From: Seebs Date: Wed, 7 Sep 2022 11:19:21 -0500 Subject: [PATCH] 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. --- stats/stats_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stats/stats_test.go b/stats/stats_test.go index 808408059..ebc62d77c 100644 --- a/stats/stats_test.go +++ b/stats/stats_test.go @@ -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) }