fix flakyness

This commit is contained in:
Laurent Perron
2025-04-27 08:59:56 +02:00
parent c49f8294c6
commit cf58b37de0
2 changed files with 7 additions and 3 deletions

View File

@@ -1273,9 +1273,12 @@ TEST_P(LargeInstanceIpParameterTest, AbsoluteGapTolerance) {
}
ASSERT_THAT(result, IsOkAndHolds(IsOptimal()));
// There should be some space between our optimal solution and best bound
EXPECT_GE(result->termination.objective_bounds.primal_bound -
result->termination.objective_bounds.dual_bound,
absolute_lp_relax_gap / 40.0);
if (GetParam().solver_type != SolverType::kCpSat) {
// CP-SAT in parallel can find the optimal solution directly.
EXPECT_GE(result->termination.objective_bounds.primal_bound -
result->termination.objective_bounds.dual_bound,
absolute_lp_relax_gap / 40.0);
}
}
// Set the relative gap to 2*(8090 - 7649)/8090 ~= 0.1 and check there is

View File

@@ -294,6 +294,7 @@ TEST(SolveCpModelTest, NonInstantiatedVariables) {
params.set_instantiate_all_variables(false);
params.set_search_branching(SatParameters::FIXED_SEARCH);
params.set_cp_model_presolve(false);
params.set_num_workers(1);
model.Add(NewSatParameters(params));
const CpSolverResponse response = SolveCpModel(model_proto, &model);