Skip to content

Commit

Permalink
Reduce number of iterations for breakdown reveal test
Browse files Browse the repository at this point in the history
We are having some flakiness with this test: https://github.com/private-attribution/ipa/actions/runs/11018449181/job/30598750956?pr=1307 and I attribute it to having too many iterations (by default it is set to 32). Even running it locally takes a long time and it is not possible to have reliable detection for large routines.
  • Loading branch information
akoshelev committed Sep 25, 2024
1 parent 1521f8b commit b51e62e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
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();
});
}
}
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 @@ mod tests {
.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

0 comments on commit b51e62e

Please sign in to comment.