mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
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:
@@ -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) *
|
||||
|
||||
Reference in New Issue
Block a user