umamaheswararao commented on a change in pull request #4058:
URL: https://github.com/apache/hadoop/pull/4058#discussion_r826576571
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/sps/TestExternalStoragePolicySatisfier.java
##########
@@ -428,6 +445,31 @@ public void testWhenStoragePolicySetToCOLD()
}
}
+ @Test(timeout = 300000)
+ public void testInfiniteStartWhenAnotherSPSRunning()
+ throws Exception {
+
+ try {
+ // Create cluster and create mover path when get NameNodeConnector.
+ createCluster(true);
+
+ // Disable system exit for assert.
+ ExitUtil.disableSystemExit();
+
+ // Get NameNodeConnector one more time to simulate starting other sps
process.
+ // It should exit immediately when another sps is running.
+ LambdaTestUtils.intercept(ExitUtil.ExitException.class,
+ "Exit immediately because another ExternalStoragePolicySatisfier is
running",
+ () -> ExternalStoragePolicySatisfier.getNameNodeConnector(config));
+
+ // Reset first exit exception to avoid AssertionError in
MiniDFSCluster#shutdown.
+ // This has no effect on functionality.
Review comment:
How about doing this reset in finally?
--
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]