diff --git a/ortools/math_opt/solver_tests/ip_parameter_tests.cc b/ortools/math_opt/solver_tests/ip_parameter_tests.cc index dfd2d2a42b..da2bd74f8d 100644 --- a/ortools/math_opt/solver_tests/ip_parameter_tests.cc +++ b/ortools/math_opt/solver_tests/ip_parameter_tests.cc @@ -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 diff --git a/ortools/sat/cp_model_solver_test.cc b/ortools/sat/cp_model_solver_test.cc index cf5963e6b8..205dd64543 100644 --- a/ortools/sat/cp_model_solver_test.cc +++ b/ortools/sat/cp_model_solver_test.cc @@ -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);