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

Reduce number of iterations for breakdown reveal test #1314

Merged
merged 1 commit into from
Sep 25, 2024
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 ipa-core/src/helpers/transport/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ mod tests {
let stream =
BodyStream::from_bytes_stream(stream::once(future::ready(Ok(Bytes::from(data)))));

stream.try_collect::<Vec<_>>().await.unwrap()
stream.try_collect::<Vec<_>>().await.unwrap();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to make this change to keep run function definition the same for shuttle and tokio executors

});
}
}
12 changes: 6 additions & 6 deletions ipa-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ pub(crate) mod test_executor {
pub(crate) mod test_executor {
use std::future::Future;

pub fn run_with<F, Fut, T, const ITER: usize>(f: F) -> T
pub fn run_with<F, Fut, const ITER: usize>(f: F)
where
F: Fn() -> Fut + Send + Sync + 'static,
Fut: Future<Output = T>,
Fut: Future<Output = ()>,
{
tokio::runtime::Builder::new_multi_thread()
// enable_all() is common to use to build Tokio runtime, but it enables both IO and time drivers.
Expand All @@ -134,16 +134,16 @@ pub(crate) mod test_executor {
.enable_time()
.build()
.unwrap()
.block_on(f())
.block_on(f());
}

#[allow(dead_code)]
pub fn run<F, Fut, T>(f: F) -> T
pub fn run<F, Fut>(f: F)
where
F: Fn() -> Fut + Send + Sync + 'static,
Fut: Future<Output = T>,
Fut: Future<Output = ()>,
{
run_with::<_, _, _, 1>(f)
run_with::<_, _, 1>(f);
}
}

Expand Down
8 changes: 6 additions & 2 deletions ipa-core/src/protocol/ipa_prf/aggregation/breakdown_reveal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub mod tests {
secret_sharing::{
replicated::semi_honest::AdditiveShare as Replicated, BitDecomposed, TransposeFrom,
},
test_executor::run,
test_executor::run_with,
test_fixture::{Reconstruct, Runner, TestWorld},
};

Expand All @@ -224,7 +224,11 @@ pub mod tests {

#[test]
fn semi_honest_happy_path() {
run(|| async {
// if shuttle executor is enabled, run this test only once.
// it is a very expensive test to explore all possible states,
// sometimes github bails after 40 minutes of running it
// (workers there are really slow).
run_with::<_, _, 3>(|| async {
let world = TestWorld::default();
let mut rng = rand::thread_rng();
let mut expectation = Vec::new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
.await
.unwrap()
})
.await
.await;

Check warning on line 535 in ipa-core/src/protocol/ipa_prf/boolean_ops/share_conversion_aby.rs

View check run for this annotation

Codecov / codecov/patch

ipa-core/src/protocol/ipa_prf/boolean_ops/share_conversion_aby.rs#L535

Added line #L535 was not covered by tests
});
}

Expand Down
Loading