jojochuang commented on code in PR #7704:
URL: https://github.com/apache/ozone/pull/7704#discussion_r1927961019
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestInputStreamBase.java:
##########
@@ -81,4 +86,38 @@ static String getNewKeyName() {
return UUID.randomUUID().toString();
}
+ protected static void updateConfig(MiniOzoneCluster cluster,
ContainerLayoutVersion layout) {
+ cluster.getHddsDatanodes().forEach(dn ->
dn.getConf().setEnum(OZONE_SCM_CONTAINER_LAYOUT_KEY, layout));
+ }
+
+ private MiniOzoneCluster cluster;
+
+ protected MiniOzoneCluster getCluster() {
+ return cluster;
+ }
+
+ @BeforeAll
+ void setup() throws Exception {
+ cluster = newCluster();
+ cluster.waitForClusterToBeReady();
+ }
+
+ @AfterAll
+ void cleanup() {
+ IOUtils.closeQuietly(cluster);
+ }
+
+ @AfterEach
+ void closeContainers() {
+ StorageContainerManager scm = cluster.getStorageContainerManager();
+ scm.getContainerManager().getContainers().forEach(container -> {
+ if (container.isOpen()) {
+ try {
+ TestHelper.waitForContainerClose(getCluster(),
container.getContainerID());
Review Comment:
I'm not sure about this.
Once open containers are closed, SCM will recreate open containers.
Containers will be created using the layout specified at the DataNodes, which
doesn't get updated until the start of the next test.
Wouldn't it make more sense to call closeContainers() after updateConfig()?
--
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]