Skip to content

Commit

Permalink
Add integration test for time-bucketed fixed size (#3025)
Browse files Browse the repository at this point in the history
  • Loading branch information
inahga authored Apr 17, 2024
1 parent d82b2d3 commit 69b5e67
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 13 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 34 additions & 1 deletion integration_tests/tests/integration/in_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ use janus_core::{
install_test_trace_subscriber,
kubernetes::{Cluster, PortForward},
},
time::DurationExt,
vdaf::VdafInstance,
};
use janus_integration_tests::{client::ClientBackend, TaskParameters};
use janus_messages::TaskId;
use janus_messages::{Duration as JanusDuration, TaskId};
use std::{env, str::FromStr, time::Duration};
use trillium_rustls::RustlsConfig;
use trillium_tokio::ClientConfig;
Expand Down Expand Up @@ -424,6 +425,13 @@ impl InClusterJanusPair {
QueryType::TimeInterval => None,
QueryType::FixedSize { max_batch_size, .. } => *max_batch_size,
},
batch_time_window_size_seconds: match task.query_type() {
QueryType::TimeInterval => None,
QueryType::FixedSize {
batch_time_window_size,
..
} => batch_time_window_size.map(|window| window.as_seconds()),
},
time_precision_seconds: task.time_precision().as_seconds(),
collector_credential_id,
};
Expand Down Expand Up @@ -559,6 +567,31 @@ async fn in_cluster_fixed_size() {
.await;
}

#[tokio::test(flavor = "multi_thread")]
async fn in_cluster_time_bucketed_fixed_size() {
install_test_trace_subscriber();
initialize_rustls();

// Start port forwards and set up task.
let janus_pair = InClusterJanusPair::new(
VdafInstance::Prio3Count,
QueryType::FixedSize {
max_batch_size: Some(110),
batch_time_window_size: Some(JanusDuration::from_hours(8).unwrap()),
},
)
.await;

// Run the behavioral test.
submit_measurements_and_verify_aggregate(
"in_cluster_time_bucketed_fixed_size",
&janus_pair.task_parameters,
(janus_pair.leader.port(), janus_pair.helper.port()),
&ClientBackend::InProcess,
)
.await;
}

#[cfg(feature = "in-cluster-rate-limits")]
mod rate_limits {
use super::InClusterJanusPair;
Expand Down

0 comments on commit 69b5e67

Please sign in to comment.