Skip to content

Commit

Permalink
Fix flaky TestPageBufferReader2 test (#1210)
Browse files Browse the repository at this point in the history
Fixes #1197

The `TestPageBufferReader2` test would fail often because of an
`off-by-1` issue. The problem can be reproduced by setting `randOffset`
to the biggest number that randInt31n may return statically like:

```
    //randOffset := int(rand.Int31n(int32(b.length)))
    randOffset := int(int32(b.length-1))
```

This makes the problem reliably reproducible as the offset is now
pointing at EOF.

Thus changing the line to this should hopefully solve the problem:
`randOffset := int(rand.Int31n(int32(b.length-1

(cherry picked from commit c51748e)
  • Loading branch information
Ibrahim Jarif committed Mar 12, 2020
1 parent a7a5976 commit 89af297
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 89af297

Please sign in to comment.