use of org.junit.BeforeClass in project flink by apache.
the class WindowCheckpointingITCase method startTestCluster.
@BeforeClass
public static void startTestCluster() {
Configuration config = new Configuration();
config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, PARALLELISM / 2);
config.setInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, 48);
cluster = new LocalFlinkMiniCluster(config, false);
cluster.start();
}
use of org.junit.BeforeClass in project flink by apache.
the class ClassLoaderITCase method setUp.
@BeforeClass
public static void setUp() throws Exception {
FOLDER.create();
Configuration config = new Configuration();
config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 2);
parallelism = 4;
// we need to use the "filesystem" state backend to ensure FLINK-2543 is not happening again.
config.setString(CoreOptions.STATE_BACKEND, "filesystem");
config.setString(FsStateBackendFactory.CHECKPOINT_DIRECTORY_URI_CONF_KEY, FOLDER.newFolder().getAbsoluteFile().toURI().toString());
// Savepoint path
config.setString(ConfigConstants.SAVEPOINT_DIRECTORY_KEY, FOLDER.newFolder().getAbsoluteFile().toURI().toString());
testCluster = new TestingCluster(config, false);
testCluster.start();
}
use of org.junit.BeforeClass in project flink by apache.
the class YARNHighAvailabilityITCase method setup.
@BeforeClass
public static void setup() {
actorSystem = AkkaUtils.createDefaultActorSystem();
try {
zkServer = new TestingServer();
zkServer.start();
} catch (Exception e) {
e.printStackTrace();
Assert.fail("Could not start ZooKeeper testing cluster.");
}
yarnConfiguration.set(YarnTestBase.TEST_CLUSTER_NAME_KEY, "flink-yarn-tests-ha");
yarnConfiguration.set(YarnConfiguration.RM_AM_MAX_ATTEMPTS, "" + numberApplicationAttempts);
startYARNWithConfig(yarnConfiguration);
}
use of org.junit.BeforeClass in project flink by apache.
the class YARNSessionFIFOSecuredITCase method setup.
@BeforeClass
public static void setup() {
LOG.info("starting secure cluster environment for testing");
yarnConfiguration.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class);
yarnConfiguration.setInt(YarnConfiguration.NM_PMEM_MB, 768);
yarnConfiguration.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 512);
yarnConfiguration.set(YarnTestBase.TEST_CLUSTER_NAME_KEY, "flink-yarn-tests-fifo-secured");
SecureTestEnvironment.prepare(tmp);
populateYarnSecureConfigurations(yarnConfiguration, SecureTestEnvironment.getHadoopServicePrincipal(), SecureTestEnvironment.getTestKeytab());
Configuration flinkConfig = new Configuration();
flinkConfig.setString(SecurityOptions.KERBEROS_LOGIN_KEYTAB, SecureTestEnvironment.getTestKeytab());
flinkConfig.setString(SecurityOptions.KERBEROS_LOGIN_PRINCIPAL, SecureTestEnvironment.getHadoopServicePrincipal());
SecurityUtils.SecurityConfiguration ctx = new SecurityUtils.SecurityConfiguration(flinkConfig, yarnConfiguration);
try {
TestingSecurityContext.install(ctx, SecureTestEnvironment.getClientSecurityConfigurationMap());
SecurityUtils.getInstalledContext().runSecured(new Callable<Object>() {
@Override
public Integer call() {
startYARNSecureMode(yarnConfiguration, SecureTestEnvironment.getHadoopServicePrincipal(), SecureTestEnvironment.getTestKeytab());
return null;
}
});
} catch (Exception e) {
throw new RuntimeException("Exception occurred while setting up secure test context. Reason: {}", e);
}
}
use of org.junit.BeforeClass in project flink by apache.
the class CliFrontendYarnAddressConfigurationTest method disableStdOutErr.
@BeforeClass
public static void disableStdOutErr() {
class NullPrint extends OutputStream {
@Override
public void write(int b) {
}
}
PrintStream nullPrinter = new PrintStream(new NullPrint());
System.setOut(nullPrinter);
System.setErr(nullPrinter);
// Unset FLINK_CONF_DIR, as this is a precondition for this test to work properly
Map<String, String> map = new HashMap<>(System.getenv());
map.remove(ConfigConstants.ENV_FLINK_CONF_DIR);
TestBaseUtils.setEnv(map);
}
Aggregations