Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

skiplist: fix TestFindGreaterOrEqual flake (compare against largest key, not value) (#10757)

Chris Luc2ea452b9dd4
diff --git a/weed/util/skiplist/skiplist_test.go b/weed/util/skiplist/skiplist_test.go
index b4c6405f8b..d8830b875b 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))
}
}
}