From cdffb0ec8eb6c90eecdf7cfe90f1821798c1ce97 Mon Sep 17 00:00:00 2001 From: rudy Date: Mon, 20 Dec 2021 10:09:57 +0100 Subject: [PATCH] fix(tests): CompileAndRunWithPrecision(6, 7 bits), more retries --- compiler/tests/unittest/end_to_end_jit_test.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/compiler/tests/unittest/end_to_end_jit_test.cc b/compiler/tests/unittest/end_to_end_jit_test.cc index 6fca6a713..b8e6036cb 100644 --- a/compiler/tests/unittest/end_to_end_jit_test.cc +++ b/compiler/tests/unittest/end_to_end_jit_test.cc @@ -475,12 +475,11 @@ TEST_P(CompileAndRunWithPrecision, identity_func) { mlir::zamalang::JitCompilerEngine::Lambda lambda = checkedJit(mlirProgram.str()); - if (precision == 7) { - // Test fails with a probability of 5% for a precision of 7. The - // probability of the test failing 5 times in a row is .05^5, - // which is less than 1:10,000 and comparable to the probability - // of failure for the other values. - static const int max_tries = 3; + if (precision >= 6) { + // This test often fails for this precision, so we need retries. + // Reason: the current encryption parameters are a little short for this precision. + + static const int max_tries = 10; for (uint64_t i = 0; i < sizeOfTLU; i++) { for (int retry = 0; retry <= max_tries; retry++) {