private void verifyKillAppSuccess( String submitter, String killer, String queueName, boolean setupACLs) throws Exception { ApplicationId applicationId = submitAppAndGetAppId(submitter, queueName, setupACLs); final KillApplicationRequest finishAppRequest = KillApplicationRequest.newInstance(applicationId); ApplicationClientProtocol ownerClient = getRMClientForUser(killer); // Kill app as killer ownerClient.forceKillApplication(finishAppRequest); resourceManager.waitForState(applicationId, RMAppState.KILLED); }
private void verifyKillAppFailure( String submitter, String killer, String queueName, boolean setupACLs) throws Exception { ApplicationId applicationId = submitAppAndGetAppId(submitter, queueName, setupACLs); final KillApplicationRequest finishAppRequest = KillApplicationRequest.newInstance(applicationId); ApplicationClientProtocol killerClient = getRMClientForUser(killer); // Kill app as the killer try { killerClient.forceKillApplication(finishAppRequest); Assert.fail("App killing by the enemy should fail!!"); } catch (YarnException e) { LOG.info("Got exception while killing app as the enemy", e); Assert.assertTrue( e.getMessage() .contains( "User " + killer + " cannot perform operation MODIFY_APP on " + applicationId)); } getRMClientForUser(submitter).forceKillApplication(finishAppRequest); }