cockroachdb / pebble

RocksDB/LevelDB inspired key-value database in Go
BSD 3-Clause "New" or "Revised" License
4.94k stars 458 forks source link

colblk: ensure test coverage of UintBuilder array doubling #4144

Closed jbowens closed 1 week ago

jbowens commented 2 weeks ago

Previously the body of the array doubling loop in UintBuilder.Set was unexercised:

for n2 <= row {
    n2 <<= 1 /* double the size */
}

In part due to the initialization that precedes the loop:

n2 := max(b.array.n<<1, 32)

This commit adds a datadriven test case that exercises it, and a new TestUintsRandomized randomized test that is reasonably likely to exercise it as well.

cockroach-teamcity commented 2 weeks ago

This change is Reviewable