Ejemplo n.º 1
0
        public async Task <bool> Until(Uri endpoint, string id)
        {
            await WaitStrategy.WaitUntil(() => WaitUntilContainerIsRunning.WaitStrategy.Until(endpoint, id));

            var exitCodes = await Task.WhenAll(this.bashCommands.Select(command => new TestcontainersClient(endpoint).ExecAsync(id, new[] { "/bin/sh", "-c", command })).ToList());

            return(exitCodes.All(exitCode => 0L.Equals(exitCode)));
        }
        public override async Task <bool> Until(string id)
        {
            await WaitStrategy.WaitUntil(() => base.Until(id));

            var exitCodes = await Task.WhenAll(this.bashCommands.Select(command => TestcontainersClient.Instance.ExecAsync(id, new[] { "/bin/bash", "-c", command })).ToList());

            return(exitCodes.All(exitCode => 0L.Equals(exitCode)));
        }
        public async Task <bool> Until(Uri endpoint, string id)
        {
            await WaitStrategy.WaitUntil(() => this.containerIsRunningWaitStrategy.Until(endpoint, id));

            if (++this.tryCount > this.maxCallCount)
            {
                throw new TimeoutException($"Number of failed operations exceeded max count ({this.maxCallCount}).");
            }

            return(this.operation());
        }
        public override async Task <bool> Until(string id)
        {
            await WaitStrategy.WaitUntil(() => base.Until(id));

            if (++this.tryCount > this.maxCallCount)
            {
                throw new TimeoutException($"Number of failed operations exceeded max count ({this.maxCallCount}).");
            }

            return(this.operation());
        }
        public override async Task <bool> Until(string id)
        {
            await WaitStrategy.WaitUntil(() => base.Until(id));

            this.outputConsumerStream.Seek(0, SeekOrigin.Begin);

            using (var streamReader = new StreamReader(this.outputConsumerStream, Encoding.UTF8, false, 4096, true))
            {
                var output = streamReader.ReadToEnd();
                return(this.messages.All(message => Regex.IsMatch(output, message)));
            }
        }
Ejemplo n.º 6
0
        public async Task <bool> Until(Uri endpoint, string id)
        {
            await WaitStrategy.WaitUntil(() => WaitUntilContainerIsRunning.WaitStrategy.Until(endpoint, id));

            this.outputConsumerStream.Seek(0, SeekOrigin.Begin);

            using (var streamReader = new StreamReader(this.outputConsumerStream, Encoding.UTF8, false, 4096, true))
            {
                var output = streamReader.ReadToEnd();
                return(this.messages.All(message => Regex.IsMatch(output, message)));
            }
        }
        public override async Task <bool> Until(string id)
        {
            await WaitStrategy.WaitUntil(() => base.Until(id));

            return(this.files.All(File.Exists));
        }
        public async Task <bool> Until(Uri endpoint, string id)
        {
            await WaitStrategy.WaitUntil(() => WaitUntilContainerIsRunning.WaitStrategy.Until(endpoint, id));

            return(this.files.All(File.Exists));
        }