Skip to content

Commit

Permalink
test: fix the CI problem in TestAutoRandomBitsData (pingcap#14823) (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored Mar 11, 2020
1 parent a517f34 commit 340d8e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions executor/ddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -776,11 +776,13 @@ func (s *testAutoRandomSuite) TestAutoRandomBitsData(c *C) {

// Test auto random id number.
c.Assert(len(allHandles), Equals, 100)
// Test the first 15 bits of each handle is greater than 0.
// Test the handles are not all zero.
allZero := true
for _, h := range allHandles {
c.Assert(h>>(64-15), Greater, int64(0))
allZero = allZero && (h>>(64-16)) == 0
}
// Test auto random id is monotonic increasing and continuous.
c.Assert(allZero, IsFalse)
// Test non-shard-bits part of auto random id is monotonic increasing and continuous.
orderedHandles := make([]int64, len(allHandles))
for i, h := range allHandles {
orderedHandles[i] = h << 16 >> 16
Expand Down

0 comments on commit 340d8e2

Please sign in to comment.