@Test(timeout = 5000)
public void testStressPolicy() throws Exception {

  // Tests how the headroom info are used to split based on the capacity
  // each RM claims to give us.
  // Configure policy to be 100% headroom based
  getPolicyInfo().setHeadroomAlpha(1.0f);
  initializePolicy();
  addHomeSubClusterAsActive();
  int numRR = 1000;
  List<ResourceRequest> resourceRequests = createLargeRandomList(numRR);
  prepPolicyWithHeadroom(true);
  int numIterations = 1000;
  long tstart = System.currentTimeMillis();
  for (int i = 0; i < numIterations; i++) {
    Map<SubClusterId, List<ResourceRequest>> response =
        ((FederationAMRMProxyPolicy) getPolicy()).splitResourceRequests(
            resourceRequests, new HashSet<SubClusterId>());
    validateSplit(response, resourceRequests);
  }
  long tend = System.currentTimeMillis();
  LOG.info("Performed " + numIterations + " policy invocations (and "
      + "validations) in " + (tend - tstart) + "ms");
}