mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
35 lines
915 B
Go
35 lines
915 B
Go
package pilosa_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/pilosa/pilosa"
|
|
"github.com/pilosa/pilosa/test"
|
|
)
|
|
|
|
// TestMonitorAntiEntropy is a regression test which which caught a bug where
|
|
// pilosa.Server was not having its remoteClient field set by an option and so
|
|
// it was using a nil client in monitorAntiEntropy.
|
|
func TestMonitorAntiEntropy(t *testing.T) {
|
|
cluster := test.MustRunMainWithCluster(t, 3, test.OptAntiEntropyInterval(time.Millisecond*1))
|
|
client := cluster[1].Client()
|
|
err := client.CreateIndex(context.Background(), "balh", pilosa.IndexOptions{})
|
|
if err != nil {
|
|
t.Fatalf("creating index: %v", err)
|
|
}
|
|
err = client.CreateField(context.Background(), "balh", "fralh", pilosa.FieldOptions{})
|
|
if err != nil {
|
|
t.Fatalf("creating field: %v", err)
|
|
}
|
|
|
|
time.Sleep(time.Millisecond * 2)
|
|
for _, m := range cluster {
|
|
err := m.Close()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
}
|