public async Task InitializeAsync() { _eventStore.Start(); try { using var httpClient = new HttpClient(new HttpClientHandler { ServerCertificateCustomValidationCallback = delegate { return(true); } }) { BaseAddress = new UriBuilder { Port = 2113, Scheme = Uri.UriSchemeHttps }.Uri }; await Policy.Handle <Exception>() .WaitAndRetryAsync(5, retryCount => TimeSpan.FromSeconds(retryCount * retryCount)) .ExecuteAsync(async() => { using var response = await httpClient.GetAsync("/health/live"); if (response.StatusCode >= HttpStatusCode.BadRequest) { throw new Exception($"Health check failed with status code: {response.StatusCode}."); } }); } catch (Exception) { _eventStore.Dispose(); throw; } await Connection.ConnectAsync(); }
private Task StopContainer() { _gitlabContainer?.Stop(); _gitlabContainer?.Dispose(); return(Task.CompletedTask); }
public ValueTask DisposeAsync() { _httpClient?.Dispose(); _eventStore?.Dispose(); return(new ValueTask(Task.CompletedTask)); }
public void Dispose() { HttpClient?.Dispose(); _testServer?.Dispose(); _streamStore?.Dispose(); _eventStore?.Dispose(); }
public FluentDockerTestBase() { Container = Build().Build(); try { Container.Start(); } catch { Container.Dispose(); throw; } OnContainerInitialized(); }
public void Initialize() { Container = Build().Build(); try { Container.Start(); } catch { Container.Dispose(); throw; } OnContainerInitialized(); }
public async Task StartAsync(CancellationToken cancellationToken = default) { _eventStore.Start(); try { await Policy.Handle <Exception>() .WaitAndRetryAsync(10, retryCount => TimeSpan.FromSeconds(2)) .ExecuteAsync(async() => { using var response = await _httpClient.GetAsync("/health/live", cancellationToken); if (response.StatusCode >= HttpStatusCode.BadRequest) { throw new Exception($"Health check failed with status code: {response.StatusCode}."); } }); } catch (Exception) { _eventStore.Dispose(); throw; } }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { OnTerminate?.Invoke(); container?.Stop(); container?.Remove(); container?.Dispose(); watcher?.Dispose(); container = null; } // TODO: free unmanaged resources (unmanaged objects) and override finalizer // TODO: set large fields to null disposedValue = true; } }
public async ValueTask DisposeAsync() { await LambdaTestHost.DisposeAsync(); var hosts = new Hosts().Discover(); var docker = hosts.FirstOrDefault(x => x.IsNative) ?? hosts.FirstOrDefault(x => x.Name == "default"); await Task.Delay(1000); _outputHelper.WriteLine("--- Begin container logs ---"); using (var logs = docker?.Host.Logs(_localStack.Id, certificates: docker.Certificates)) { var line = logs !.Read(); while (line != null) { _outputHelper.WriteLine(line); line = logs !.Read(); } } _outputHelper.WriteLine("--- End container logs ---"); _localStack.RemoveOnDispose = true; _localStack.Dispose(); }
public void Dispose() { container.Dispose(); }
public void Dispose() { _service?.Dispose(); }
public void Dispose() { _image?.Dispose(); _runningImage?.Dispose(); }
public Task DisposeAsync() { _stepFunctionsLocal.RemoveOnDispose = true; _stepFunctionsLocal.Dispose(); return(Task.CompletedTask); }
/// <summary> /// Disposes and shuts down the container. /// </summary> public void Dispose() { _containerService.Dispose(); }
public void Dispose() { _image?.Dispose(); }