summaryrefslogtreecommitdiffhomepage
path: root/test/perf/linux
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2021-08-17 12:55:41 -0700
committergVisor bot <gvisor-bot@google.com>2021-08-17 12:58:37 -0700
commit8f6c54c8c023d551d6d09b5428ac59fb704c7067 (patch)
tree80f7d9bd70c3d77021207b1a9e14246d36133f8a /test/perf/linux
parentebf76b30cb46386b7414876b826f8a7fa177ce11 (diff)
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
Diffstat (limited to 'test/perf/linux')
-rw-r--r--test/perf/linux/randread_benchmark.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/perf/linux/randread_benchmark.cc b/test/perf/linux/randread_benchmark.cc
index b0eb8c24e..11b56a8cb 100644
--- a/test/perf/linux/randread_benchmark.cc
+++ b/test/perf/linux/randread_benchmark.cc
@@ -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) *