From c589e9837cad8e856d98991444a4ac3dc479bdd9 Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 8 Mar 2023 01:48:28 -0800 Subject: [PATCH] fix tests --- weed/storage/needle_map_metric_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/storage/needle_map_metric_test.go b/weed/storage/needle_map_metric_test.go index 5645a015f..96919d103 100644 --- a/weed/storage/needle_map_metric_test.go +++ b/weed/storage/needle_map_metric_test.go @@ -16,7 +16,7 @@ func TestFastLoadingNeedleMapMetrics(t *testing.T) { for i := 0; i < 10000; i++ { nm.Put(Uint64ToNeedleId(uint64(i+1)), Uint32ToOffset(uint32(0)), Size(1)) - if rand.Float32() < 0.2 { + if rand.Float32() < 0.2 && i > 0 { nm.Delete(Uint64ToNeedleId(uint64(rand.Int63n(int64(i))+1)), Uint32ToOffset(uint32(0))) } }