Skip to content

Commit 00cffd1

Browse files
authored
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 <[email protected]> Signed-off-by: Shilun Fan <[email protected]>
1 parent 1d4c4e4 commit 00cffd1

File tree

1 file changed

+3
-2
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/store/records

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,16 +425,17 @@ public void testSubClusterInfoEqual() throws Exception {
425425
String scRmAdminAddress = "5.6.7.8:7";
426426
String scWebAppAddress = "127.0.0.1:8080";
427427
String capabilityJson = "-";
428+
long currentTime = Time.now();
428429

429430
SubClusterInfo sc1 =
430431
SubClusterInfo.newInstance(SubClusterId.newInstance("SC-1"),
431432
scAmRMAddress, scClientRMAddress, scRmAdminAddress, scWebAppAddress,
432-
SubClusterState.SC_RUNNING, Time.now(), capabilityJson);
433+
SubClusterState.SC_RUNNING, currentTime, capabilityJson);
433434

434435
SubClusterInfo sc2 =
435436
SubClusterInfo.newInstance(SubClusterId.newInstance("SC-1"),
436437
scAmRMAddress, scClientRMAddress, scRmAdminAddress, scWebAppAddress,
437-
SubClusterState.SC_RUNNING, Time.now(), capabilityJson);
438+
SubClusterState.SC_RUNNING, currentTime, capabilityJson);
438439

439440
assertEquals(sc1, sc2);
440441
}

0 commit comments

Comments
 (0)