From 3d10af9d47970f130a9c774cc6dc12beb5706ac0 Mon Sep 17 00:00:00 2001 From: Travis Date: Tue, 2 Mar 2021 17:14:58 -0600 Subject: [PATCH] fix SaveMeta test; ensure storage backend env is used --- field_internal_test.go | 6 +++++- pilosa.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/field_internal_test.go b/field_internal_test.go index ac20e89e3..3705b321d 100644 --- a/field_internal_test.go +++ b/field_internal_test.go @@ -209,7 +209,9 @@ func NewTestField(t *testing.T, opts FieldOption) *TestField { t.Fatal(err) } - h := NewHolder(path, DefaultHolderConfig()) + cfg := DefaultHolderConfig() + cfg.StorageConfig.Backend = CurrentBackendOrDefault() + h := NewHolder(path, cfg) panicOn(h.Open()) idx, err := h.CreateIndex("i", IndexOptions{}) @@ -940,6 +942,8 @@ func TestField_SaveMeta(t *testing.T) { t.Fatal(err) } else if !changed { t.Fatal("expected SetValue to return changed = true") + } else if err := tx.Commit(); err != nil { + t.Fatal(err) } if f.options.BitDepth != expBitDepth { diff --git a/pilosa.go b/pilosa.go index 370144c9d..c00b082b5 100644 --- a/pilosa.go +++ b/pilosa.go @@ -208,7 +208,7 @@ func CurrentBackend() string { } // CurrentBackendOrDefault tries the environment variable first, but falls back -// to the default backed if the environment variable is empty. +// to the default backend if the environment variable is empty. func CurrentBackendOrDefault() string { if backend := os.Getenv("PILOSA_STORAGE_BACKEND"); backend != "" { return backend