Deflake test/perf:randread_benchmark

The test expects that pread reads the full buffer, it means that the pread
offset has to be equal or less than file_size - buffer_size.

PiperOrigin-RevId: 391356863
This commit is contained in:
Andrei Vagin
2021-08-17 12:58:37 -07:00
committed by gVisor bot
parent ebf76b30cb
commit 8f6c54c8c0
+1 -1
View File
@@ -85,7 +85,7 @@ void BM_RandRead(benchmark::State& state) {
unsigned int seed = 1;
for (auto _ : state) {
TEST_CHECK(PreadFd(fd.get(), buf.data(), buf.size(),
rand_r(&seed) % kFileSize) == size);
rand_r(&seed) % (kFileSize - buf.size())) == size);
}
state.SetBytesProcessed(static_cast<int64_t>(size) *