umamaheswararao commented on code in PR #3529:
URL: https://github.com/apache/ozone/pull/3529#discussion_r904619448
##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestWritableECContainerProvider.java:
##########
@@ -261,12 +263,18 @@ public Pipeline createPipeline(ReplicationConfig repConf,
provider = new WritableECContainerProvider(
conf, pipelineManager, containerManager, pipelineChoosingPolicy);
- ContainerInfo container =
- provider.getContainer(1, repConfig, OWNER, new ExcludeList());
+ try {
+ provider.getContainer(1, repConfig, OWNER, new ExcludeList());
+ } catch (IOException ex) {
+ GenericTestUtils.assertExceptionContains("Cannot create pipelines", ex);
+ }
+
for (int i = 0; i < 5; i++) {
- ContainerInfo nextContainer =
- provider.getContainer(1, repConfig, OWNER, new ExcludeList());
- assertEquals(container, nextContainer);
+ try {
+ provider.getContainer(1, repConfig, OWNER, new ExcludeList());
Review Comment:
Same as above. Please few other places need to handle this.
##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestWritableECContainerProvider.java:
##########
@@ -234,9 +234,11 @@ public Pipeline createPipeline(ReplicationConfig repConf,
provider = new WritableECContainerProvider(
conf, pipelineManager, containerManager, pipelineChoosingPolicy);
- ContainerInfo container =
- provider.getContainer(1, repConfig, OWNER, new ExcludeList());
- assertNull(container);
+ try {
+ provider.getContainer(1, repConfig, OWNER, new ExcludeList());
Review Comment:
You have to add Assert.fail here. Lets say if above statement does not throw
exception, then case will pass.
--
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]