Bläddra i källkod

YARN-11822. Fix flaky unit test in TestFederationProtocolRecords (#7718) Contributed by Peter Szucs.

* YARN-11822. Fix flaky unit test in TestFederationProtocolRecords

Reviewed-by: Shilun Fan <slfan1989@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
Peter Szucs 4 veckor sedan
förälder
incheckning
00cffd15bd

+ 3 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/store/records/TestFederationProtocolRecords.java

@@ -425,16 +425,17 @@ public class TestFederationProtocolRecords extends BasePBImplRecordsTest {
     String scRmAdminAddress = "5.6.7.8:7";
     String scWebAppAddress = "127.0.0.1:8080";
     String capabilityJson = "-";
+    long currentTime = Time.now();
 
     SubClusterInfo sc1 =
         SubClusterInfo.newInstance(SubClusterId.newInstance("SC-1"),
         scAmRMAddress, scClientRMAddress, scRmAdminAddress, scWebAppAddress,
-        SubClusterState.SC_RUNNING, Time.now(), capabilityJson);
+        SubClusterState.SC_RUNNING, currentTime, capabilityJson);
 
     SubClusterInfo sc2 =
         SubClusterInfo.newInstance(SubClusterId.newInstance("SC-1"),
         scAmRMAddress, scClientRMAddress, scRmAdminAddress, scWebAppAddress,
-        SubClusterState.SC_RUNNING, Time.now(), capabilityJson);
+        SubClusterState.SC_RUNNING, currentTime, capabilityJson);
 
     assertEquals(sc1, sc2);
   }