From f2d4c7e746735d99452010d02b9ee9d5de1101c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= <121866228+aborgna-q@users.noreply.github.com> Date: Wed, 15 Nov 2023 12:57:33 +0100 Subject: [PATCH] test: fix non-deterministic badger test (#245) We shouldn't check the optimised circuit vs a fixed output. This fixes some spurious test failures: https://github.com/CQCL/tket2/actions/runs/6876784637/job/18703089884?pr=244 --- tket2/src/optimiser/badger.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tket2/src/optimiser/badger.rs b/tket2/src/optimiser/badger.rs index 516726fa..99de887b 100644 --- a/tket2/src/optimiser/badger.rs +++ b/tket2/src/optimiser/badger.rs @@ -480,8 +480,7 @@ mod tests { #[rstest] fn rz_rz_cancellation_parallel(rz_rz: Hugr, badger_opt: DefaultBadgerOptimiser) { - let opt_rz = badger_opt.optimise(&rz_rz, Some(0), 2.try_into().unwrap(), false, 4); - // No optimization done due to the zero timeout. - assert_eq!(gates(&opt_rz), vec![T2Op::RzF64, T2Op::RzF64]); + let mut opt_rz = badger_opt.optimise(&rz_rz, Some(0), 2.try_into().unwrap(), false, 4); + opt_rz.update_validate(®ISTRY).unwrap(); } }