diff --git a/tests/properties.rs b/tests/properties.rs index 91ec38d..9f04310 100644 --- a/tests/properties.rs +++ b/tests/properties.rs @@ -26,7 +26,10 @@ const KEYS: [&str; 8] = ["a", "b", "c", "d", "e", "f", "g", "h"]; fn history_from(games: &[(usize, usize)]) -> History { let mut h = History::builder() .convergence(ConvergenceOptions { - max_iter: 200, + // 200 was not enough: the batched side stopped at the cap with a + // step of 3.4e-9, so this test was comparing two truncated fits and + // attributing the gap to ingestion order. + max_iter: 20_000, epsilon: 1e-10, ..ConvergenceOptions::default() }) @@ -114,14 +117,21 @@ proptest! { fn ingestion_order_does_not_change_the_answer(games in pairs()) { let batched = { let mut h = history_from(&games); - let _ = h.converge().unwrap(); + let report = h.converge().unwrap(); + prop_assert!( + report.converged, + "batched side stopped at {} iterations with step {:?}; comparing \ + two fits that have not converged measures truncation, not order", + report.iterations, + report.final_step + ); h }; let incremental = { let mut h = History::builder() .convergence(ConvergenceOptions { - max_iter: 200, + max_iter: 20_000, epsilon: 1e-10, ..ConvergenceOptions::default() }) @@ -139,7 +149,13 @@ proptest! { .unwrap(); } - let _ = h.converge().unwrap(); + let report = h.converge().unwrap(); + prop_assert!( + report.converged, + "incremental side stopped at {} iterations with step {:?}", + report.iterations, + report.final_step + ); h };