flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOITCase.java
/**
	 * The test cluster has the following resources:
	 * - 2 Nodes with 4096 MB each.
	 * - RM_SCHEDULER_MINIMUM_ALLOCATION_MB is 512
	 *
	 * We allocate:
	 * 1 JobManager with 256 MB (will be automatically upgraded to 512 due to min alloc mb)
	 * 2 TaskManagers with 3840 MB
	 *
	 * the user sees a total request of: 7936 MB (fits)
	 * the system sees a request of: 8192 MB (fits)
	 * HOWEVER: one machine is going to need 3840 + 512 = 4352 MB, which doesn't fit.
	 *
	 * --> check if the system properly rejects allocating this session.
	 */
The test cluster has the following resources:
- 2 Nodes with 4096 MB each.
- RM_SCHEDULER_MINIMUM_ALLOCATION_MB is 512

We allocate:
1 JobManager with 256 MB (will be automatically upgraded to 512 due to min alloc mb)
2 TaskManagers with 3840 MB

the user sees a total request of: 7936 MB (fits)
the system sees a request of: 8192 MB (fits)
HOWEVER: one machine is going to need 3840 + 512 = 4352 MB, which doesn't fit.

> check if the system properly rejects allocating this session.
The test cluster has the following resources : - 2 Nodes with 4096 MB each . - RM_SCHEDULER_MINIMUM_ALLOCATION_MB is 512 We allocate : 1 JobManager with 256 MB ( will be automatically upgraded to 512 due to min alloc mb ) 2 TaskManagers with 3840 MB the user sees a total request of : 7936 MB ( fits ) the system sees a request of : 8192 MB ( fits ) HOWEVER : one machine is going to need 3840 + 512 = 4352 MB which doesn ' t fit . > check if the system properly rejects allocating this session .
@Ignore("The test is too resource consuming (8 GB of memory)")
	@Test
	public void testfullAlloc() {
		addTestAppender(YarnClusterDescriptor.class, Level.WARN);
		LOG.info("Starting testfullAlloc()");
		runWithArgs(new String[]{"-j", flinkUberjar.getAbsolutePath(), "-t", flinkLibFolder.getAbsolutePath(),
				"-n", "2",
				"-jm", "256",
				"-tm", "3840"}, "Number of connected TaskManagers changed to", null, RunTypes.YARN_SESSION, 0);
		LOG.info("Finished testfullAlloc()");
		checkForLogString("There is not enough memory available in the YARN cluster. The TaskManager(s) require 3840MB each. NodeManagers available: [4096, 4096]\n" +
				"After allocating the JobManager (512MB) and (1/2) TaskManagers, the following NodeManagers are available: [3584, 256]");
	}
@ Ignore ( "The test is too resource consuming (8 GB of memory)" ) @ Test public void testfullAlloc ( ) { addTestAppender ( YarnClusterDescriptor . class , Level . WARN ) ; LOG . info ( "Starting testfullAlloc()" ) ; runWithArgs ( new String [ ] { "-j" , flinkUberjar . getAbsolutePath ( ) , "-t" , flinkLibFolder . getAbsolutePath ( ) , "-n" , "2" , "-jm" , "256" , "-tm" , "3840" } , "Number of connected TaskManagers changed to" , null , RunTypes . YARN_SESSION , 0 ) ; LOG . info ( "Finished testfullAlloc()" ) ; checkForLogString ( "There is not enough memory available in the YARN cluster. The TaskManager(s) require 3840MB each. NodeManagers available: [4096, 4096]\n" + "After allocating the JobManager (512MB) and (1/2) TaskManagers, the following NodeManagers are available: [3584, 256]" ) ; }
The test cluster has the following resources:
 - 2 Nodes with 4096 MB each.
The test cluster has the following resources : - 2 Nodes with 4096 MB each .