From 87bd49563e9fec4abb1609d68e799c6b84f23f11 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 7 Sep 2022 11:50:03 +0300 Subject: [PATCH] [#1761] pilorama: Use batch size of 1 for tests Improve tests speed by a lot and use more iterations in `ApplyRandom` test. Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/pilorama/forest_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/local_object_storage/pilorama/forest_test.go b/pkg/local_object_storage/pilorama/forest_test.go index 4cac6362f..016a78efe 100644 --- a/pkg/local_object_storage/pilorama/forest_test.go +++ b/pkg/local_object_storage/pilorama/forest_test.go @@ -31,7 +31,9 @@ var providers = []struct { tmpDir, err := os.MkdirTemp(os.TempDir(), "*") require.NoError(t, err) - f := NewBoltForest(WithPath(filepath.Join(tmpDir, "test.db"))) + f := NewBoltForest( + WithPath(filepath.Join(tmpDir, "test.db")), + WithMaxBatchSize(1)) require.NoError(t, f.Open(false)) require.NoError(t, f.Init()) t.Cleanup(func() { @@ -486,9 +488,9 @@ func testForestTreeApplyRandom(t *testing.T, constructor func(t testing.TB) Fore rand.Seed(42) const ( - nodeCount = 4 - opCount = 10 - iterCount = 100 + nodeCount = 5 + opCount = 20 + iterCount = 200 ) cid := cidtest.ID()