From 2c26abc551693d40bbe2e8ee24df0c3cf1dd4f18 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 22 Jul 2021 12:16:44 +0300 Subject: [PATCH] add badger markset test --- blockstore/splitstore/markset_badger.go | 2 +- blockstore/splitstore/markset_test.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/blockstore/splitstore/markset_badger.go b/blockstore/splitstore/markset_badger.go index 41d2601c3..fd979e2e8 100644 --- a/blockstore/splitstore/markset_badger.go +++ b/blockstore/splitstore/markset_badger.go @@ -29,7 +29,7 @@ type BadgerMarkSet struct { var _ MarkSet = (*BadgerMarkSet)(nil) -const badgerMarkSetBatchSize = 65536 +var badgerMarkSetBatchSize = 65536 func NewBadgerMarkSetEnv(path string) (MarkSetEnv, error) { msPath := filepath.Join(path, "markset.badger") diff --git a/blockstore/splitstore/markset_test.go b/blockstore/splitstore/markset_test.go index d5c01e220..38519949a 100644 --- a/blockstore/splitstore/markset_test.go +++ b/blockstore/splitstore/markset_test.go @@ -16,6 +16,15 @@ func TestBloomMarkSet(t *testing.T) { testMarkSet(t, "bloom") } +func TestBadgerMarkSet(t *testing.T) { + bs := badgerMarkSetBatchSize + badgerMarkSetBatchSize = 1 + t.Cleanup(func() { + badgerMarkSetBatchSize = bs + }) + testMarkSet(t, "badger") +} + func testMarkSet(t *testing.T, lsType string) { t.Helper()