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

skiplist: compare against the largest key, not its value, in TestFindGreaterOrEqual
This commit is contained in:
Chris Lu
2026-08-14 08:31:31 -07:00
committed by GitHub
parent d713ab49f9
commit c2ea452b9d
+3 -4
View File
@@ -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))
}
}
}