Skip to content

Commit 4b6abaa

Browse files
authored
Stabilize release-maven by removing race-prone assertion in testBatchUseCase3 (#93)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 3e24d71 commit 4b6abaa

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

OpenICF-java-framework/connector-framework-internal/src/test/java/org/identityconnectors/framework/impl/api/LocalConnectorInfoManagerTests.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import org.identityconnectors.framework.common.objects.Subscription;
4949
import org.identityconnectors.framework.common.objects.Uid;
5050
import org.identityconnectors.framework.api.operations.batch.BatchBuilder;
51+
import org.identityconnectors.framework.api.operations.batch.BatchTask;
5152
import org.testng.Assert;
5253
import org.testng.annotations.Test;
5354

@@ -319,15 +320,16 @@ public void onNext(BatchResult batchResult) {
319320
}
320321
};
321322

322-
Subscription sub = facade.executeBatch(batch.build(), observer, options);
323-
assertEquals(results.size(), 0);
324-
assertFalse(isComplete.get());
325-
assertFalse(hasError.get());
323+
final List<BatchTask> batchTasks = batch.build();
324+
Subscription sub = facade.executeBatch(batchTasks, observer, options);
326325
assertNotNull(sub.getReturnValue());
327326

328-
Thread.sleep(500);
327+
final long timeout = System.currentTimeMillis() + 3000;
328+
while (!isComplete.get() && System.currentTimeMillis() < timeout) {
329+
Thread.sleep(100);
330+
}
329331

330-
assertEquals(results.size(), batch.build().size());
332+
assertEquals(results.size(), batchTasks.size());
331333
assertTrue(isComplete.get());
332334
assertFalse(hasError.get());
333335

0 commit comments

Comments
 (0)