echonesis commented on code in PR #11341:
URL: https://github.com/apache/ozone/pull/11341#discussion_r4152573619
##########
hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconAsPassiveScm.java:
##########
@@ -91,15 +89,22 @@ public void testDatanodeRegistrationAndReports() throws
Exception {
PipelineManager reconPipelineManager = reconScm.getPipelineManager();
PipelineManager scmPipelineManager = scm.getPipelineManager();
- LambdaTestUtils.await(60000, 5000,
- () -> (reconPipelineManager.getPipelines().size() >= 4));
-
- // Verify if Recon has all the pipelines from SCM.
- scmPipelineManager.getPipelines().forEach(p -> {
+ // SCM and Recon update their pipeline state asynchronously. Validate the
+ // complete SCM snapshot inside the retry loop so a pipeline created after
+ // Recon reaches the expected count does not cause a one-shot failure.
+ LambdaTestUtils.await(60000, 5000, () -> {
+ if (scmPipelineManager.getPipelines().size() < 4) {
+ return false;
+ }
try {
- assertNotNull(reconPipelineManager.getPipeline(p.getId()));
+ for (Pipeline pipeline : scmPipelineManager.getPipelines()) {
Review Comment:
Could we capture `scmPipelineManager.getPipelines()` once per retry and use
that list for both the size check and iteration? Each call returns a separate
snapshot, so this would keep the two checks consistent with the “complete SCM
snapshot” comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]