adoroszlai opened a new pull request, #5930:
URL: https://github.com/apache/ozone/pull/5930

   ## What changes were proposed in this pull request?
   
   Fix intermittent failure in 
`TestWritableRatisContainerProvider#skipsPipelineWithoutContainer`.
   
   One of the pipelines has a container (stubbing for `getMatchingContainer`), 
the other doesn't.  Mocks return `null` for calls without stubbing, and the 
test relies on that for the pipeline without container.  The problem is that 
Mockito is also strict by default.  When it sees the non-stubbed pipeline, it 
reports this error.  Pipelines are returned by `getPipelines` in the right 
order (one without container first), but the order in which they are actually 
checked depends on `PipelineChoosePolicy`.
   
   The problem can be reproduced by changing the test case to 
`@RepeatedTest(100)`.
   
   The fix sets lenient mode for Mockito in the test class to be able to rely 
on the default.
   
   This also exposed another problem: lists used by the test as return value 
for stubbed `getPipelines` do not support `remove` (invoked by 
`WritableRatisContainerProvider` during iteration of pipelines).  This is fixed 
by wrapping in `ArrayList`.
   
   https://issues.apache.org/jira/browse/HDDS-10070
   
   ## How was this patch tested?
   
   Unit test passes with `@RepeatedTest(100)` (which is left in place to catch 
such problems in the future).
   
   CI: (pending)


-- 
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]

Reply via email to