use of io.pravega.client.control.impl.ControllerImplConfig in project pravega by pravega.
the class PravegaEmulatorResource method waitUntilHealthy.
/*
* Wait until Pravega standalone is up and running.
*/
private void waitUntilHealthy() {
ClientConfig clientConfig = getClientConfig();
ControllerImplConfig controllerConfig = ControllerImplConfig.builder().clientConfig(clientConfig).retryAttempts(20).initialBackoffMillis(1000).backoffMultiple(2).maxBackoffMillis(10000).build();
@Cleanup StreamManager streamManager = new StreamManagerImpl(clientConfig, controllerConfig);
assertNotNull(streamManager);
// Try creating a scope. This will retry based on the provided retry configuration.
// If all the retries fail a RetriesExhaustedException will be thrown failing the tests.
boolean isScopeCreated = streamManager.createScope("healthCheck-scope");
log.debug("Health check scope creation is successful {}", isScopeCreated);
}
use of io.pravega.client.control.impl.ControllerImplConfig in project pravega by pravega.
the class TlsEnabledInProcPravegaClusterTest method testCreateStreamFailsWithInvalidClientConfig.
/**
* This test verifies that create stream fails when the client config is invalid.
*
* Note: The timeout being used for the test is kept rather large so that there is ample time for the expected
* exception to be raised even in case of abnormal delays in test environments.
*/
@Test(timeout = 50000)
public void testCreateStreamFailsWithInvalidClientConfig() {
// Truststore for the TLS connection is missing.
ClientConfig clientConfig = ClientConfig.builder().controllerURI(URI.create(EMULATOR.pravega.getInProcPravegaCluster().getControllerURI())).build();
ControllerImplConfig controllerImplConfig = ControllerImplConfig.builder().clientConfig(clientConfig).retryAttempts(1).initialBackoffMillis(1000).backoffMultiple(1).maxBackoffMillis(1000).build();
@Cleanup StreamManager streamManager = new StreamManagerImpl(clientConfig, controllerImplConfig);
AssertExtensions.assertThrows("TLS exception did not occur.", () -> streamManager.createScope(scope), e -> hasTlsException(e));
}
Aggregations