Skip to content

Stabilize release-maven by removing race-prone assertion in testBatchUseCase3#93

Merged
vharseko merged 2 commits into
masterfrom
copilot/fix-release-maven-job
Jun 14, 2026
Merged

Stabilize release-maven by removing race-prone assertion in testBatchUseCase3#93
vharseko merged 2 commits into
masterfrom
copilot/fix-release-maven-job

Conversation

Copilot AI commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

release-maven was failing due to a flaky async timing assumption in LocalConnectorInfoManagerTests.testBatchUseCase3. The test asserted zero results immediately after executeBatch, which intermittently fails when callbacks arrive before that assertion.

  • Root cause

    • testBatchUseCase3 relied on fixed-delay timing (Thread.sleep(500)) and an immediate results.size() == 0 check in an asynchronous path.
  • What changed

    • Reworked the test to assert deterministic end-state instead of transient pre-callback state.
    • Built the batch once and reused it for execution/size assertions.
    • Replaced fixed sleep with bounded completion polling (up to 3s) via isComplete.
  • Behavioral impact

    • No production code changes.
    • Test now validates async batch completion semantics without race sensitivity.
final List<BatchTask> batchTasks = batch.build();
Subscription sub = facade.executeBatch(batchTasks, observer, options);

final long timeout = System.currentTimeMillis() + 3000;
while (!isComplete.get() && System.currentTimeMillis() < timeout) {
    Thread.sleep(100);
}

assertEquals(results.size(), batchTasks.size());
assertTrue(isComplete.get());
assertFalse(hasError.get());

Copilot AI changed the title [WIP] Fix failing GitHub Actions job release-maven Stabilize release-maven by removing race-prone assertion in testBatchUseCase3 Jun 14, 2026
Copilot AI requested a review from vharseko June 14, 2026 12:18
@vharseko vharseko marked this pull request as ready for review June 14, 2026 12:40
@vharseko vharseko merged commit 4b6abaa into master Jun 14, 2026
17 checks passed
@vharseko vharseko deleted the copilot/fix-release-maven-job branch June 14, 2026 12:40
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