question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Timeout Exception on VSTS Test Platform (Azure DevOps), with private build agent

See original GitHub issue

In release 1.4.20 I get a timeout exception everytime the test agent tries to start the FluentMockServer

Following exception is thrown right after "FluentMockServer.Start()"

System.TimeoutException : Service start timed out after 00:00:10
Stack trace
   at WireMock.Server.FluentMockServer..ctor(IFluentMockServerSettings settings) in /Server/FluentMockServer.cs:line 225
   at WireMock.Server.FluentMockServer.Start(Nullable`1 port, Boolean ssl) in /Server/FluentMockServer.cs:line 110

I don’t get this when running the test locally. I’ve tried turning off the windows firewall entirely, on the build machine, but it doesn’t make any difference. I still get the timeout exception. After seeing issue #146, I reverted to version 1.3.18 and I don’t experience any timeout exception anymore.

Anybody know what’s causing the timeout exception?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
StefHcommented, Nov 30, 2018

version 1.0.4.21 will implement code fixes as proposed by @backlune

1reaction
backlunecommented, Nov 30, 2018

Been having the same issue on one of our slower build servers. The reason for getting a TimeoutException might be different as some exceptions are not observed when starting the server.

To find out why we were getting TimeoutException I changed to checking it the task had an exception before throwing timeout in FluentMockServer constructor.

            var startTask = _httpServer.StartAsync();

            using (var ctsStartTimeout = new CancellationTokenSource(settings.StartTimeout))
            {
                while (!_httpServer.IsStarted)
                {
                    // Throw out exception if service start fails
                    if (_httpServer.RunningException != null)
                    {
                        throw new Exception($"Service start failed with error: {_httpServer.RunningException.Message}", _httpServer.RunningException);
                    }

                    // Respect start timeout setting by throwing TimeoutException
                    if (ctsStartTimeout.IsCancellationRequested)
                    {
                        if (startTask.Exception != null) { throw startTask.Exception; }
                        throw new TimeoutException($"Service start timed out after {TimeSpan.FromMilliseconds(settings.StartTimeout)}");
                    }

                    ctsStartTimeout.Token.WaitHandle.WaitOne(ServerStartDelay);
                }
            }

In our case a System.IO.FileNotFoundException was being thrown (Not sure why yet but seen some issue with our nugetpackages)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Timeouts on self hosted agents should run "Forever ...
Hello,. I'm running a job on a self hosted agent. The job runs several scripts in bash command which take time (in case...
Read more >
VSTest task in Azure devops timing out after 60 minutes
If your project is private and you are using hosted agent, check this doc: One free parallel job that can run for up...
Read more >
Troubleshoot pipeline runs - Azure DevOps
A pipeline may run for a long time and then fail due to job time-out. Job timeout closely depends on the agent being...
Read more >
Solving Long, flaky testing with Azure DevOps - Tsuyoshi Ushio
The first try. Unfortunately, the task has been canceled. The reason is it took over 30 min. By default, Hosted agent will be...
Read more >
Automating Selenium Tests in Azure Pipelines
Let us configure a private self-hosted agent on this VM. Selenium requires the agent to be run in interactive mode to execute the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found