Ejemplo n.º 1
0
        public static async Task<bool> WaitForStorageContainerAsync(TemporaryStorageContainer container, ILogger logger)
        {
            return await RetryHelper.RetryTask(async r =>
            {
                if (await container.CheckContainerAliveAsync())
                {
                    return true;
                }

                logger.LogInformation(
                    $"Waiting for temporary storage container {container.DockerContainerId} to be accessible (retry {r})"
                );

                return false;
            }, 30, TimeSpan.FromSeconds(1));
        }
Ejemplo n.º 2
0
        public static async Task<bool> WaitForContainerToStopAsync(
            string containerId,
            DockerClientManager clientManager,
            ILogger logger
        )
        {
            return await RetryHelper.RetryTask(async r =>
            {
                var response = await clientManager.InspectContainerAsync(containerId);

                if (!response.DockerResponse.State.Running)
                {
                    return true;
                }

                logger.LogInformation($"Waiting for container {containerId} to stop (retry {r})");

                return false;
            }, 30, TimeSpan.FromSeconds(1));
        }
Ejemplo n.º 3
0
 private async Task RunTest(uint retries)
 {
     await RetryHelper.RetryTask(retry => AttemptRetry(), retries, TimeSpan.Zero);
 }