slfan1989 commented on code in PR #4701:
URL: https://github.com/apache/hadoop/pull/4701#discussion_r938344693


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/utils/TestFederationStateStoreFacade.java:
##########
@@ -206,4 +206,19 @@ public void testAddApplicationHomeSubCluster() throws 
YarnException {
     Assert.assertEquals(subClusterId1, result);
   }
 
+  @Test
+  public void testGetApplicationHomeSubClusterCache() throws YarnException {
+    ApplicationId appId = ApplicationId.newInstance(clusterTs, numApps + 1);
+    SubClusterId subClusterId1 = SubClusterId.newInstance("Home1");
+
+    ApplicationHomeSubCluster appHomeSubCluster =
+        ApplicationHomeSubCluster.newInstance(appId, subClusterId1);
+    SubClusterId subClusterIdAdd =
+        facade.addApplicationHomeSubCluster(appHomeSubCluster);
+
+    SubClusterId subClusterIdCache = 
facade.getApplicationHomeSubCluster(appId);
+    Assert.assertEquals(subClusterIdCache, subClusterIdAdd);

Review Comment:
   This is related to this test class.
   
   This test class uses junit's Parameterized, which will be tested twice. The 
cache effective configuration is initialized in the constructor. The first 
setting cache does not take effect, and the second setting cache takes effect.
   
   ```
   @RunWith(Parameterized.class)
   public class TestFederationStateStoreFacade {
       public TestFederationStateStoreFacade(Boolean isCachingEnabled) {
       conf = new Configuration();
       if (!(isCachingEnabled.booleanValue())) {
         conf.setInt(YarnConfiguration.FEDERATION_CACHE_TIME_TO_LIVE_SECS, 0);
       }
     }
   }
   ```
   



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