Skip to content

Commit

Permalink
Make get_large_img generate random, badly compressible data
Browse files Browse the repository at this point in the history
  • Loading branch information
arpad-m committed Aug 9, 2024
1 parent c84abb8 commit 211166a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pageserver/src/tenant/storage_layer/split_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ impl SplitDeltaLayerWriter {

#[cfg(test)]
mod tests {
use rand::{RngCore, SeedableRng};

use crate::{
tenant::{
harness::{TenantHarness, TIMELINE_ID},
Expand All @@ -229,7 +231,10 @@ mod tests {
}

fn get_large_img() -> Bytes {
vec![0; 8192].into()
let mut rng = rand::rngs::SmallRng::seed_from_u64(42);
let mut data = vec![0; 8192];
rng.fill_bytes(&mut data);
data.into()
}

#[tokio::test]
Expand Down

0 comments on commit 211166a

Please sign in to comment.