fix(tests): CompileAndRunWithPrecision(6, 7 bits), more retries

This commit is contained in:
rudy
2021-12-20 10:09:57 +01:00
committed by Ayoub Benaissa
parent d8fee32cea
commit cdffb0ec8e

View File

@@ -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++) {