Wait doesn't seem to work
See original GitHub issueI have the below code which has a Wait call().
When I call start I’d expect that to block until the Wait delegate had succeeded but this isn’t the case.  Despite this if I put a breakpoint on the delegate it never gets hit. Any ideas?  Thanks
        protected override Task OnStart(CancellationToken cancellationToken)
        {
            try
            {
                this.Logger.LogInformation("Starting MS SQL Server container. This may take a few minutes if the image is not in local cache.");
                this.containerService = new Builder()
                    .UseContainer()
                    .WithName("profiles-sql-server")
                    .UseImage("mcr.microsoft.com/mssql/server:2017-latest-ubuntu")
                    .WithEnvironment("ACCEPT_EULA=Y", $"SA_PASSWORD={SAPassword}", "MSSQL_MEMORY_LIMIT_MB=4000")
                    .ReuseIfExists()
                    .ExposePort(21433, 1433)
                    //.WaitForPort("1433/tcp", 5000)
                    .Wait("profiles-sql-server", (service, count) =>
                    {
                        if (count > 10)
                        {
                            throw new FluentDockerException("Failed to wait for sql server");
                        }
                        using (var connection = new SqlConnection(CreateMasterConnectionStringBuilder().ConnectionString))
                        {
                            try
                            {
                                connection.Open();
                                return 0; //Zero and below means success
                            }
                            catch (Exception)
                            {
                                return 500; //The time to wait until next execution
                            }
                        }
                    })
                    .Build();
                this.containerService.Start();
            }
            catch (FluentDockerException ex) when (ex.Message.Contains("Error response from daemon: Conflict"))
            {
                this.Logger.LogInformation("MS SQL Server container already running.");
            }
            return Task.CompletedTask;
        }
Issue Analytics
- State:
 - Created 4 years ago
 - Comments:11 (2 by maintainers)
 
Top Results From Across the Web
Python Selenium Wait not working / Java Selenium Question
1 Try not to mix implicit and explicit waits. It can lead to unpredictable wait periods. Check here for more info.
Read more >C# WaitForSeconds doesn't seem to work
Hello everyone, I'm trying to write a script that when the player looses, an animation is displayed (it's an explosion) then the function ......
Read more >Wait command works when pid doesn't exists
Run wait with no argument to remove finished jobs from the job table, and you'll see that you can no longer retrieve the...
Read more >wait /d - not working on window 10 and windows 2019 server
I am trying to create script that launches notpad.exe, waits till it closes, then runs one final command. Based on my research, I...
Read more >Wait=true does not appear to be working as intended... #109
I tested with a simple namespace creation/deletion. Here's the terraform destroy for the namespace resource. ➜ tf apply plan.tfplan module.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Have just tried the new release and seems well!
Thanks a lot!
On Fri, 31 May 2019 at 14:50, Mario Toffia notifications@github.com wrote:
@jchannon they are independent in the sense that you register them one after the other, but upon starting the container, from reading the code, they seem to be executed as a sequence. Meaning, first
WaitForPortthenWaitForLambda.