Skip to content

Stabilize submitMoreProblemsThanCpus_allGetSolved by removing host-CPU dependence#2367

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-flaky-solvermanagertest
Draft

Stabilize submitMoreProblemsThanCpus_allGetSolved by removing host-CPU dependence#2367
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-flaky-solvermanagertest

Conversation

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown

SolverManagerTest.submitMoreProblemsThanCpus_allGetSolved() was flaky because its load was derived from Runtime.availableProcessors(), making timing and scheduling behavior host-dependent. This could intermittently stall on job.getFinalBestSolution() under high iteration counts.

  • Deterministic oversubscription setup

    • Set a fixed parallelSolverCount (2) for this test path.
    • Compute problemCount from that value (parallelSolverCount * 2) so the test still guarantees “more jobs than solver threads”.
  • Targeted helper update

    • Changed createSolverManagerTestableByDifferentConsumers() to accept parallelSolverCount.
    • Constructed SolverManager with SolverManagerConfig.withParallelSolverCount(...) for this test scenario.
var parallelSolverCount = 2;
var problemCount = parallelSolverCount * 2;
try (var solverManager = createSolverManagerTestableByDifferentConsumers(parallelSolverCount)) {
    assertSolveWithoutConsumer(problemCount, solverManager);
    assertSolveWithConsumer(problemCount, solverManager, true);
    assertSolveWithConsumer(problemCount, solverManager, false);
}

Copilot AI changed the title [WIP] Fix flakiness in SolverManagerTest.submitMoreProblemsThanCpus_allGetSolved Stabilize submitMoreProblemsThanCpus_allGetSolved by removing host-CPU dependence Jun 12, 2026
Copilot AI requested a review from triceo June 12, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants