Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check DB schema version at startup #1272

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aggregator/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2548,7 +2548,7 @@ mod tests {
.build();

let ephemeral_datastore = ephemeral_datastore().await;
let datastore = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let datastore = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);

datastore.put_task(&task).await.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion aggregator/src/aggregator/aggregate_init_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub(super) async fn setup_aggregate_init_test() -> AggregationJobInitTestCase {
let task = TaskBuilder::new(QueryType::TimeInterval, VdafInstance::Fake, Role::Helper).build();
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let datastore = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let datastore = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);

datastore.put_task(&task).await.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion aggregator/src/aggregator/aggregation_job_continue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ mod tests {
TaskBuilder::new(QueryType::TimeInterval, VdafInstance::Fake, Role::Helper).build();
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let datastore = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let datastore = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);

let report_generator = ReportShareGenerator::new(
clock.clone(),
Expand Down
10 changes: 5 additions & 5 deletions aggregator/src/aggregator/aggregation_job_creator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ mod tests {
install_test_trace_subscriber();
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = ephemeral_datastore.datastore(clock.clone());
let ds = ephemeral_datastore.datastore(clock.clone()).await;
let vdaf = dummy_vdaf::Vdaf::new();

// TODO(#234): consider using tokio::time::pause() to make time deterministic, and allow
Expand Down Expand Up @@ -913,7 +913,7 @@ mod tests {
install_test_trace_subscriber();
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = ephemeral_datastore.datastore(clock.clone());
let ds = ephemeral_datastore.datastore(clock.clone()).await;
let vdaf = dummy_vdaf::Vdaf::new();
const MIN_AGGREGATION_JOB_SIZE: usize = 50;
const MAX_AGGREGATION_JOB_SIZE: usize = 60;
Expand Down Expand Up @@ -1009,7 +1009,7 @@ mod tests {
install_test_trace_subscriber();
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = ephemeral_datastore.datastore(clock.clone());
let ds = ephemeral_datastore.datastore(clock.clone()).await;
let vdaf = dummy_vdaf::Vdaf::new();
let task = Arc::new(
TaskBuilder::new(
Expand Down Expand Up @@ -1121,7 +1121,7 @@ mod tests {
install_test_trace_subscriber();
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = ephemeral_datastore.datastore(clock.clone());
let ds = ephemeral_datastore.datastore(clock.clone()).await;
let vdaf = dummy_vdaf::Vdaf::new();

const MIN_AGGREGATION_JOB_SIZE: usize = 50;
Expand Down Expand Up @@ -1240,7 +1240,7 @@ mod tests {
install_test_trace_subscriber();
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = ephemeral_datastore.datastore(clock.clone());
let ds = ephemeral_datastore.datastore(clock.clone()).await;

const MAX_AGGREGATION_JOB_SIZE: usize = 10;

Expand Down
14 changes: 7 additions & 7 deletions aggregator/src/aggregator/aggregation_job_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ mod tests {
let clock = MockClock::default();
let mut runtime_manager = TestRuntimeManager::new();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = Arc::new(Prio3::new_count(2).unwrap());
let task = TaskBuilder::new(
QueryType::TimeInterval,
Expand Down Expand Up @@ -1149,7 +1149,7 @@ mod tests {
let mut server = mockito::Server::new_async().await;
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = Arc::new(Prio3::new_count(2).unwrap());

let task = TaskBuilder::new(
Expand Down Expand Up @@ -1443,7 +1443,7 @@ mod tests {
let mut server = mockito::Server::new_async().await;
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = Arc::new(Prio3::new_count(2).unwrap());

let task = TaskBuilder::new(
Expand Down Expand Up @@ -1675,7 +1675,7 @@ mod tests {
let mut server = mockito::Server::new_async().await;
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = Arc::new(Prio3::new_count(2).unwrap());

let task = TaskBuilder::new(
Expand Down Expand Up @@ -1964,7 +1964,7 @@ mod tests {
let mut server = mockito::Server::new_async().await;
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = Arc::new(Prio3::new_count(2).unwrap());

let task = TaskBuilder::new(
Expand Down Expand Up @@ -2235,7 +2235,7 @@ mod tests {
install_test_trace_subscriber();
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = Arc::new(Prio3::new_count(2).unwrap());

let task = TaskBuilder::new(
Expand Down Expand Up @@ -2421,7 +2421,7 @@ mod tests {
let clock = MockClock::default();
let mut runtime_manager = TestRuntimeManager::new();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);

let task = TaskBuilder::new(
QueryType::TimeInterval,
Expand Down
8 changes: 4 additions & 4 deletions aggregator/src/aggregator/collection_job_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ mod tests {
let mut server = mockito::Server::new_async().await;
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);

let time_precision = Duration::from_seconds(500);
let task = TaskBuilder::new(QueryType::TimeInterval, VdafInstance::Fake, Role::Leader)
Expand Down Expand Up @@ -904,7 +904,7 @@ mod tests {
let mut server = mockito::Server::new_async().await;
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);

let (_, lease, collection_job) =
setup_collection_job_test_case(&mut server, clock, Arc::clone(&ds), true).await;
Expand Down Expand Up @@ -959,7 +959,7 @@ mod tests {
let clock = MockClock::default();
let mut runtime_manager = TestRuntimeManager::new();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);

let (task, _, collection_job) =
setup_collection_job_test_case(&mut server, clock.clone(), Arc::clone(&ds), false)
Expand Down Expand Up @@ -1052,7 +1052,7 @@ mod tests {
let mut server = mockito::Server::new_async().await;
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);

let (task, lease, collection_job) =
setup_collection_job_test_case(&mut server, clock, Arc::clone(&ds), true).await;
Expand Down
2 changes: 1 addition & 1 deletion aggregator/src/aggregator/collection_job_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub(crate) async fn setup_collection_job_test_case(
.build();
let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let datastore = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let datastore = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);

datastore.put_task(&task).await.unwrap();

Expand Down
8 changes: 4 additions & 4 deletions aggregator/src/aggregator/garbage_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mod tests {

let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = dummy_vdaf::Vdaf::new();

// Setup.
Expand Down Expand Up @@ -267,7 +267,7 @@ mod tests {

let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = dummy_vdaf::Vdaf::new();

// Setup.
Expand Down Expand Up @@ -434,7 +434,7 @@ mod tests {

let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = dummy_vdaf::Vdaf::new();

// Setup.
Expand Down Expand Up @@ -592,7 +592,7 @@ mod tests {

let clock = MockClock::default();
let ephemeral_datastore = ephemeral_datastore().await;
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()));
let ds = Arc::new(ephemeral_datastore.datastore(clock.clone()).await);
let vdaf = dummy_vdaf::Vdaf::new();

// Setup.
Expand Down
Loading