Skip to content

Commit 3b4eef2

Browse files
committed
YARN-11898. TestRMHA.testTransitionedToStandbyShouldNotHang hangs
This does NOT fix the issue, only adds a timeout to stop it from hanging and reporting the error instead of hanging forever
1 parent 8392373 commit 3b4eef2

File tree

1 file changed

+4
-1
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager

1 file changed

+4
-1
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.File;
2323
import java.nio.file.Files;
2424
import java.util.UUID;
25+
import java.util.concurrent.TimeUnit;
2526
import java.util.function.Supplier;
2627
import org.apache.hadoop.test.GenericTestUtils;
2728
import org.apache.hadoop.util.concurrent.SubjectInheritingThread;
@@ -33,6 +34,7 @@
3334
import static org.junit.jupiter.api.Assertions.assertNotNull;
3435
import static org.junit.jupiter.api.Assertions.assertTrue;
3536
import static org.junit.jupiter.api.Assertions.fail;
37+
import static org.junit.jupiter.api.Timeout.ThreadMode.SEPARATE_THREAD;
3638

3739
import java.io.IOException;
3840
import java.net.InetSocketAddress;
@@ -475,6 +477,7 @@ public synchronized void startInternal() throws Exception {
475477
}
476478

477479
@Test
480+
@Timeout(value=60, unit = TimeUnit.SECONDS, threadMode = SEPARATE_THREAD)
478481
public void testTransitionedToStandbyShouldNotHang() throws Exception {
479482
configuration.setBoolean(YarnConfiguration.AUTO_FAILOVER_ENABLED, false);
480483
Configuration conf = new YarnConfiguration(configuration);
@@ -611,7 +614,7 @@ protected void serviceStart() throws Exception {
611614
}
612615

613616
@Test
614-
@Timeout(value = 9000)
617+
@Timeout(value = 9000) // FIXME that's more than two hours
615618
public void testTransitionedToActiveRefreshFail() throws Exception {
616619
configuration.setBoolean(YarnConfiguration.AUTO_FAILOVER_ENABLED, false);
617620
rm = new MockRM(configuration) {

0 commit comments

Comments
 (0)