devmadhuu commented on code in PR #11626:
URL: https://github.com/apache/ozone/pull/11626#discussion_r4511677534


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMStoragePolicyUpgrade.java:
##########
@@ -129,79 +89,41 @@ private void preFinalizationChecks() throws Exception {
     // Controls: the gate must not reject requests that carry no storage 
policy field
     createBucket(null, null);
     // The client API must not add a policy field on its own, or the gate 
rejects this request.
-    String clientCreated = "buck-" + UUID.randomUUID();
-    client.getObjectStore().getVolume(VOLUME_NAME).createBucket(clientCreated);
-    assertThat(omClient.getBucketInfo(VOLUME_NAME, 
clientCreated).getStoragePolicy()).isNull();
-    omClient.setBucketProperty(OmBucketArgs.newBuilder()
+    String clientCreated = createBucket(null, null);
+    assertThat(getOmClient().getBucketInfo(VOLUME_NAME, 
clientCreated).getStoragePolicy()).isNull();
+
+    getOmClient().setBucketProperty(OmBucketArgs.newBuilder()
         .setVolumeName(VOLUME_NAME)
         .setBucketName(bucketName)
         .setIsVersionEnabled(true)
         .build());
-    assertThat(omClient.getBucketInfo(VOLUME_NAME, bucketName)
+    assertThat(getOmClient().getBucketInfo(VOLUME_NAME, bucketName)
         .getStoragePolicy()).isNull();
   }
 
-  /** Trigger OM upgrade finalization and block until it completes. */
-  private void finalizeOMUpgrade() throws Exception {
-    omClient.finalizeUpgrade();
-    waitForFinalization(omClient);
-  }
-
   private void postFinalizationChecks() throws Exception {
-    
assertThat(cluster.getOzoneManager().getVersionManager().getApparentVersion())
-        .isEqualTo(OzoneManagerVersion.SOFTWARE_VERSION);
+    assertStoragePolicyFinalized();
 
-    // CreateBucket through the client API without storage policy options: the 
OM applies its configured default.
-    String defaultPolicyBucket = "buck-" + UUID.randomUUID();
-    
client.getObjectStore().getVolume(VOLUME_NAME).createBucket(defaultPolicyBucket);
-    OmBucketInfo defaultedPolicyBucketInfo = 
omClient.getBucketInfo(VOLUME_NAME, defaultPolicyBucket);
+    // CreateBucket without storage policy options: the OM applies its 
configured default.
+    String defaultPolicyBucket = createBucket(null, null);

Review Comment:
   Same as above, use client API.



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