コード例 #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)));
        }
コード例 #3
0
        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());
        }
コード例 #4
0
        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());
        }
コード例 #5
0
        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)));
            }
        }
コード例 #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)));
            }
        }
コード例 #7
0
        public override async Task <bool> Until(string id)
        {
            await WaitStrategy.WaitUntil(() => base.Until(id));

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

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