From c2ea452b9dd4c40d6fc56d05e7bae282c91281fe Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 14 Aug 2026 08:31:31 -0700 Subject: [PATCH] skiplist: fix TestFindGreaterOrEqual flake (compare against largest key, not value) (#10757) skiplist: compare against the largest key, not its value, in TestFindGreaterOrEqual --- weed/util/skiplist/skiplist_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/weed/util/skiplist/skiplist_test.go b/weed/util/skiplist/skiplist_test.go index b4c6405f8..d8830b875 100644 --- a/weed/util/skiplist/skiplist_test.go +++ b/weed/util/skiplist/skiplist_test.go @@ -295,10 +295,9 @@ func TestFindGreaterOrEqual(t *testing.T) { } } else { lastNode, _ := list.GetLargestNode() - lastV := lastNode.GetValue() - // It is OK, to fail, as long as f is bigger than the last element. - if bytes.Compare(key, lastV) <= 0 { - t.Errorf("lastV: %s\n key: %s\n\n", string(lastV), string(key)) + // It is OK, to fail, as long as the key is bigger than the largest key. + if bytes.Compare(key, lastNode.Key) <= 0 { + t.Errorf("largest key: %s\n key: %s\n\n", string(lastNode.Key), string(key)) } } }