Skip to content

Commit

Permalink
shortify old test
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed May 13, 2024
1 parent ed9d00c commit 0cb35f5
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions crates/re_query/tests/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,34 +872,26 @@ fn concurrent_multitenant_edge_case() -> anyhow::Result<()> {

let entity_path: EntityPath = "point".into();

let timepoint1 = [build_frame_nr(123)];
let points1 = vec![MyPoint::new(1.0, 2.0), MyPoint::new(3.0, 4.0)];
let row1 = DataRow::from_cells1_sized(
RowId::new(),
entity_path.clone(),
timepoint1,
points1.clone(),
)?;
insert_and_react(&mut store, &mut caches, &row1);
let add_points = |time: i64, point_value: f32| {
let timepoint = [build_frame_nr(time)];
let points = vec![
MyPoint::new(point_value, point_value + 1.0),
MyPoint::new(point_value + 2.0, point_value + 3.0),
];
let row = DataRow::from_cells1_sized(
RowId::new(),
entity_path.clone(),
timepoint,
points.clone(),
)?;
Ok::<_, DataReadError>((timepoint, points, row))
};

let timepoint2 = [build_frame_nr(223)];
let points2 = vec![MyPoint::new(10.0, 20.0), MyPoint::new(30.0, 40.0)];
let row2 = DataRow::from_cells1_sized(
RowId::new(),
entity_path.clone(),
timepoint2,
points2.clone(),
)?;
let (timepoint1, points1, row1) = add_points(123, 1.0)?;
insert_and_react(&mut store, &mut caches, &row1);
let (_timepoint2, points2, row2) = add_points(223, 2.0)?;
insert_and_react(&mut store, &mut caches, &row2);

let timepoint3 = [build_frame_nr(323)];
let points3 = vec![MyPoint::new(100.0, 200.0), MyPoint::new(300.0, 400.0)];
let row3 = DataRow::from_cells1_sized(
RowId::new(),
entity_path.clone(),
timepoint3,
points3.clone(),
)?;
let (_timepoint3, points3, row3) = add_points(323, 3.0)?;
insert_and_react(&mut store, &mut caches, &row3);

// --- Tenant #1 queries the data, but doesn't cache the result in the deserialization cache ---
Expand Down

0 comments on commit 0cb35f5

Please sign in to comment.