Skip to content

Commit

Permalink
storageccl: fix flakey TestRandomKeyAndTimestampExport
Browse files Browse the repository at this point in the history
Sometimes the maxSize would line up exactly with the last key. When this
happened the logic to test the maxSize parameter was incorrect. This adds
logic to deal with that case and unflake the test.

Fixes #44589

Release note: None
  • Loading branch information
ajwerner committed Feb 3, 2020
1 parent a3a8760 commit 0855e01
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/ccl/storageccl/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,12 @@ func assertEqualKVs(
lessThisKey := dataSizeWhenExceeded - uint64(len(kv.Key.Key)+len(kv.Value))
if lessThisKey >= maxSize {
dataSizeWhenExceeded = lessThisKey
// It might be the case that this key would lead to an SST of exactly
// max size, in this case we overwrite max size to be less so that
// we still generate an error.
if dataSizeWhenExceeded == maxSize {
maxSize--
}
} else {
break
}
Expand Down

0 comments on commit 0855e01

Please sign in to comment.