Skip to content

Commit 808208b

Browse files
committed
Remove useless import.
1 parent e613bd7 commit 808208b

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,16 @@
2929
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
3030
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
3131
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestCapacitySchedulerAsyncScheduling;
32+
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestUtils;
3233
import org.apache.hadoop.yarn.util.resource.DominantResourceCalculator;
3334
import org.apache.hadoop.yarn.util.resource.ResourceCalculator;
3435
import org.junit.Assert;
3536
import org.junit.Before;
3637
import org.junit.Test;
37-
import org.junit.contrib.java.lang.system.internal.NoExitSecurityManager;
3838

3939
import java.util.Arrays;
4040
import java.util.List;
4141

42-
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestUtils.waitForUntilTimeout;
43-
4442
public class TestRMHAForAsyncScheduler extends RMHATestBase {
4543
private TestCapacitySchedulerAsyncScheduling.NMHeartbeatThread
4644
nmHeartbeatThread = null;
@@ -156,7 +154,7 @@ public void testAsyncScheduleThreadExit() throws Exception {
156154
checkAsyncSchedulerThreads(Thread.currentThread());
157155

158156
// wait for RM to be shutdown until timeout
159-
boolean done = waitForUntilTimeout(
157+
boolean done = TestUtils.waitForUntilTimeout(
160158
() -> rm1.getRMContext().getHAServiceState()
161159
== HAServiceProtocol.HAServiceState.STANDBY, 100, 5000);
162160
Assert.assertTrue(
@@ -169,7 +167,7 @@ public void testAsyncScheduleThreadExit() throws Exception {
169167
HAServiceProtocol.RequestSource.REQUEST_BY_USER);
170168
rm2.adminService.transitionToStandby(requestInfo);
171169
rm1.adminService.transitionToActive(requestInfo);
172-
done = waitForUntilTimeout(
170+
done = TestUtils.waitForUntilTimeout(
173171
() -> rm1.getRMContext().getHAServiceState()
174172
== HAServiceProtocol.HAServiceState.ACTIVE, 100, 5000);
175173
Assert.assertTrue(

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacitySchedulerAsyncScheduling.java

+1-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
package org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity;
2020

21-
import org.apache.hadoop.ha.HAServiceProtocol;
2221
import org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableList;
2322
import org.apache.hadoop.conf.Configuration;
2423
import org.apache.hadoop.yarn.api.records.Container;
@@ -65,11 +64,9 @@
6564
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.SimpleCandidateNodeSet;
6665
import org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey;
6766
import org.apache.hadoop.yarn.util.resource.Resources;
68-
import org.jline.utils.Log;
6967
import org.junit.Assert;
7068
import org.junit.Before;
7169
import org.junit.Test;
72-
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
7370
import org.junit.contrib.java.lang.system.internal.NoExitSecurityManager;
7471
import org.mockito.Mockito;
7572
import org.mockito.invocation.InvocationOnMock;
@@ -80,10 +77,6 @@
8077
import java.util.List;
8178
import java.util.concurrent.atomic.AtomicBoolean;
8279

83-
import static org.apache.hadoop.service.Service.STATE.STOPPED;
84-
import static org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestUtils.waitForUntilTimeout;
85-
import static org.mockito.Mockito.doThrow;
86-
8780
public class TestCapacitySchedulerAsyncScheduling {
8881
private final int GB = 1024;
8982

@@ -1103,7 +1096,7 @@ public void testAsyncScheduleThreadExit() throws Exception {
11031096
cs.setResourceCalculator(null);
11041097

11051098
// wait for RM to be shutdown until timeout
1106-
boolean done = waitForUntilTimeout(
1099+
boolean done = TestUtils.waitForUntilTimeout(
11071100
noExitSecurityManager::isCheckExitCalled, 100, 5000);
11081101
Assert.assertTrue("RM should be shut down, but nothing happened", done);
11091102
} finally {

0 commit comments

Comments
 (0)