peterxcli commented on code in PR #11341:
URL: https://github.com/apache/ozone/pull/11341#discussion_r4162562001
##########
hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconAsPassiveScm.java:
##########
@@ -91,16 +89,18 @@ 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 -> {
- try {
- assertNotNull(reconPipelineManager.getPipeline(p.getId()));
- } catch (PipelineNotFoundException e) {
- fail();
+ // 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, () -> {
+ List<Pipeline> scmPipelines = scmPipelineManager.getPipelines();
+ if (scmPipelines.size() < 4) {
+ return false;
+ }
+ for (Pipeline pipeline : scmPipelines) {
+ reconPipelineManager.getPipeline(pipeline.getId());
}
Review Comment:
this is no-op.
either keep with an additional wait for recon pipeline sync:
```java
scmPipelineManager.getPipelines().forEach(p -> {
try {
assertNotNull(reconPipelineManager.getPipeline(p.getId()));
} catch (PipelineNotFoundException e) {
fail();
}
```
or if it's not easy yo wit for reconPipelineManager up-to-date, do this:
```java
LambdaTestUtils.await(60000, 5000, () -> {
List<Pipeline> scmPipelines = scmPipelineManager.getPipelines();
if (scmPipelines.size() < 4) {
return false;
}
for (Pipeline pipeline : scmPipelines) {
Pipeline p = reconPipelineManager.getPipeline(pipeline.getId());
if (p == null) return false;
}
```
--
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]