|
@@ -76,6 +76,7 @@ import org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.Candida
|
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SimpleCandidateNodeSet;
|
|
|
import org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey;
|
|
|
import org.apache.hadoop.yarn.util.resource.Resources;
|
|
|
+import org.junit.jupiter.api.Assumptions;
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
import org.junit.jupiter.api.Timeout;
|
|
@@ -1103,17 +1104,23 @@ public class TestCapacitySchedulerAsyncScheduling {
|
|
|
@Test
|
|
|
@Timeout(value = 30)
|
|
|
public void testAsyncScheduleThreadExit() throws Exception {
|
|
|
- // init RM & NM
|
|
|
- final MockRM rm = new MockRM(conf);
|
|
|
- rm.start();
|
|
|
- rm.registerNode("192.168.0.1:1234", 8 * GB);
|
|
|
- rm.drainEvents();
|
|
|
|
|
|
// Set no exit security manager to catch System.exit
|
|
|
SecurityManager originalSecurityManager = System.getSecurityManager();
|
|
|
NoExitSecurityManager noExitSecurityManager =
|
|
|
new NoExitSecurityManager(originalSecurityManager);
|
|
|
- System.setSecurityManager(noExitSecurityManager);
|
|
|
+ try {
|
|
|
+ System.setSecurityManager(noExitSecurityManager);
|
|
|
+ } catch (UnsupportedOperationException e) {
|
|
|
+ Assumptions.assumeTrue(false,
|
|
|
+ "Test is skipped because SecurityManager cannot be set (JEP411)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // init RM & NM
|
|
|
+ final MockRM rm = new MockRM(conf);
|
|
|
+ rm.start();
|
|
|
+ rm.registerNode("192.168.0.1:1234", 8 * GB);
|
|
|
+ rm.drainEvents();
|
|
|
|
|
|
// test async-scheduling thread exit
|
|
|
try{
|