will-sh opened a new pull request, #6409:
URL: https://github.com/apache/ozone/pull/6409

   ## What changes were proposed in this pull request?
   HDDS-10311. Speed up TestOzoneManagerHAWithStoppedNodes
   
   Please describe your PR in detail:
   - Start/Stop cluster in @BeforeAll,@AfterAll, aim to only start one cluster 
for all tests
   - change assertCounter to assertEqual to assert the "current value" with 
"initial value" + "expected increment value" , the "initial value" is fetched 
at the beginning of each subtest. 
   - modified some resource names between subtests to ensure no conflict in the 
same cluster.
   
   This PR isn't finished yet and I face a problem, I would like to solve this 
and commit again.
   Problem:
   Some tests likely cannot use the same cluster, if I comment out all the 
startCluster() and shutdown(), the below OM dummyException happens:
   [ERROR]   TestOmMetrics.testAclOperations:663 » OM dummyException
   `663   client.getObjectStore().createVolume("volumeacl");`
   [ERROR]   TestOmMetrics.testAclOperationsHA:691 » OM dummyException
   `691    objectStore.createVolume("volumeaclha");`
   [ERROR]   TestOmMetrics.testKeyOps:345 » OM dummyException
   `345    TestDataUtil.createVolumeAndBucket(client, volumeName, bucketName, 
BucketLayout.LEGACY);`
   [ERROR]   TestOmMetrics.testSnapshotOps:558->createBucketInfo:884 » OM 
dummyException
   `884    OmBucketInfo omBucketInfo = createBucketInfo(false);`
   
   If make these 4 tests shutdown(); startCluster(); in the beginning, the test 
is successful and test time is:
   ```
   [INFO] 
org.apache.hadoop.ozone.om.TestOmMetrics.testDirectoryOps(BucketLayout)[1]  
Time elapsed: 4.643 s
   [INFO] 
org.apache.hadoop.ozone.om.TestOmMetrics.testDirectoryOps(BucketLayout)[2]  
Time elapsed: 0.349 s
   [INFO] org.apache.hadoop.ozone.om.TestOmMetrics.testBucketOps  Time elapsed: 
0.791 s
   [INFO] org.apache.hadoop.ozone.om.TestOmMetrics.testVolumeOps  Time elapsed: 
0.184 s
   [INFO] org.apache.hadoop.ozone.om.TestOmMetrics.testSnapshotOps  Time 
elapsed: 26.363 s
   [INFO] org.apache.hadoop.ozone.om.TestOmMetrics.testAclOperationsHA  Time 
elapsed: 21.584 s
   [INFO] org.apache.hadoop.ozone.om.TestOmMetrics.testAclOperations  Time 
elapsed: 21.613 s
   [INFO] org.apache.hadoop.ozone.om.TestOmMetrics.testKeyOps  Time elapsed: 
21.907 s
   ```
   Compared to those that don't restart the cluster, the most time may spent on 
shutdown() startCluster().
   
   ## What is the link to the Apache JIRA
   
   Please create an issue in ASF JIRA before opening a pull request, and you 
need to set the title of the pull
   request which starts with the corresponding JIRA issue number. (e.g. 
HDDS-XXXX. Fix a typo in YYY.)
   https://issues.apache.org/jira/browse/HDDS-10311
   
   ## How was this patch tested?
   mvn test -Dtest=TestOmMetrics -Dsurefire.reportFormat='plain'
   


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