|
@@ -61,7 +61,7 @@ public class TestRMAppTransitions {
|
|
static final Log LOG = LogFactory.getLog(TestRMAppTransitions.class);
|
|
static final Log LOG = LogFactory.getLog(TestRMAppTransitions.class);
|
|
|
|
|
|
private RMContext rmContext;
|
|
private RMContext rmContext;
|
|
- private static int maxRetries = 4;
|
|
|
|
|
|
+ private static int maxAppAttempts = 4;
|
|
private static int appId = 1;
|
|
private static int appId = 1;
|
|
private DrainDispatcher rmDispatcher;
|
|
private DrainDispatcher rmDispatcher;
|
|
|
|
|
|
@@ -167,8 +167,8 @@ public class TestRMAppTransitions {
|
|
String name = MockApps.newAppName();
|
|
String name = MockApps.newAppName();
|
|
String queue = MockApps.newQueue();
|
|
String queue = MockApps.newQueue();
|
|
Configuration conf = new YarnConfiguration();
|
|
Configuration conf = new YarnConfiguration();
|
|
- // ensure max retries set to known value
|
|
|
|
- conf.setInt(YarnConfiguration.RM_AM_MAX_RETRIES, maxRetries);
|
|
|
|
|
|
+ // ensure max application attempts set to known value
|
|
|
|
+ conf.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, maxAppAttempts);
|
|
YarnScheduler scheduler = mock(YarnScheduler.class);
|
|
YarnScheduler scheduler = mock(YarnScheduler.class);
|
|
ApplicationMasterService masterService =
|
|
ApplicationMasterService masterService =
|
|
new ApplicationMasterService(rmContext, scheduler);
|
|
new ApplicationMasterService(rmContext, scheduler);
|
|
@@ -437,7 +437,7 @@ public class TestRMAppTransitions {
|
|
|
|
|
|
RMApp application = testCreateAppAccepted(null);
|
|
RMApp application = testCreateAppAccepted(null);
|
|
// ACCEPTED => ACCEPTED event RMAppEventType.RMAppEventType.ATTEMPT_FAILED
|
|
// ACCEPTED => ACCEPTED event RMAppEventType.RMAppEventType.ATTEMPT_FAILED
|
|
- for (int i=1; i<maxRetries; i++) {
|
|
|
|
|
|
+ for (int i=1; i < maxAppAttempts; i++) {
|
|
RMAppEvent event =
|
|
RMAppEvent event =
|
|
new RMAppFailedAttemptEvent(application.getApplicationId(),
|
|
new RMAppFailedAttemptEvent(application.getApplicationId(),
|
|
RMAppEventType.ATTEMPT_FAILED, "");
|
|
RMAppEventType.ATTEMPT_FAILED, "");
|
|
@@ -452,7 +452,7 @@ public class TestRMAppTransitions {
|
|
}
|
|
}
|
|
|
|
|
|
// ACCEPTED => FAILED event RMAppEventType.RMAppEventType.ATTEMPT_FAILED
|
|
// ACCEPTED => FAILED event RMAppEventType.RMAppEventType.ATTEMPT_FAILED
|
|
- // after max retries
|
|
|
|
|
|
+ // after max application attempts
|
|
String message = "Test fail";
|
|
String message = "Test fail";
|
|
RMAppEvent event =
|
|
RMAppEvent event =
|
|
new RMAppFailedAttemptEvent(application.getApplicationId(),
|
|
new RMAppFailedAttemptEvent(application.getApplicationId(),
|
|
@@ -500,7 +500,7 @@ public class TestRMAppTransitions {
|
|
Assert.assertEquals(expectedAttemptId,
|
|
Assert.assertEquals(expectedAttemptId,
|
|
appAttempt.getAppAttemptId().getAttemptId());
|
|
appAttempt.getAppAttemptId().getAttemptId());
|
|
// RUNNING => FAILED/RESTARTING event RMAppEventType.ATTEMPT_FAILED
|
|
// RUNNING => FAILED/RESTARTING event RMAppEventType.ATTEMPT_FAILED
|
|
- for (int i=1; i<maxRetries; i++) {
|
|
|
|
|
|
+ for (int i=1; i<maxAppAttempts; i++) {
|
|
RMAppEvent event =
|
|
RMAppEvent event =
|
|
new RMAppFailedAttemptEvent(application.getApplicationId(),
|
|
new RMAppFailedAttemptEvent(application.getApplicationId(),
|
|
RMAppEventType.ATTEMPT_FAILED, "");
|
|
RMAppEventType.ATTEMPT_FAILED, "");
|
|
@@ -525,7 +525,7 @@ public class TestRMAppTransitions {
|
|
}
|
|
}
|
|
|
|
|
|
// RUNNING => FAILED/RESTARTING event RMAppEventType.ATTEMPT_FAILED
|
|
// RUNNING => FAILED/RESTARTING event RMAppEventType.ATTEMPT_FAILED
|
|
- // after max retries
|
|
|
|
|
|
+ // after max application attempts
|
|
RMAppEvent event =
|
|
RMAppEvent event =
|
|
new RMAppFailedAttemptEvent(application.getApplicationId(),
|
|
new RMAppFailedAttemptEvent(application.getApplicationId(),
|
|
RMAppEventType.ATTEMPT_FAILED, "");
|
|
RMAppEventType.ATTEMPT_FAILED, "");
|