tag:help.appveyor.com,2012-11-13:/discussions/problems/753-constant-build-failuresAppVeyor: Discussion 2018-10-19T08:16:43Ztag:help.appveyor.com,2012-11-13:Comment/344633882014-09-05T10:29:49Z2014-09-05T10:29:49ZConstant build failures<div><p>Hello Feodor. I'm experiencing constant build failures due to
different reasons. All of these problems started to appear
approximately in july (perhaps after Scott Hanselman's effect).
Before that build failures always reflected problems with my
project itself.</p>
<ol>
<li>Problems with uploading of xUnit test runner results:</li>
</ol>
<pre>
<code>Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The operation has timed out
290
291 Server stack trace:
292 at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)
293 at System.Net.WebClient.UploadData(Uri address, String method, Byte[] data)
294 at Appveyor.BuildAgent.Api.BuildServices.UpdateTest(String testName, String testFramework, String fileName, TestOutcome outcome, Nullable`1 durationMilliseconds, String errorMessage, String errorStackTrace, String stdOut, String stdErr) in c:\Projects\Appveyor\appveyor\Appveyor.BuildAgent.Api\BuildServices.cs:line 122
295 at Xunit.ConsoleClient.AppveyorRunnerCallback.TestPassed(TestMethod method, TestPassedResult result)
296 at Xunit.ConsoleClient.RunnerCallback.TestFinished(TestMethod method)
297 at Xunit.ExecutorWrapper.XmlNodeCallbackHandlerWithICallbackEventHandler.RaiseCallbackEvent(String result)</code>
</pre>
<ol>
<li>Build job fails after 30 minutes timeout. However, average
build time for successful builds is about 8 minutes. I can't
understand what happens - sometimes build hangs on integration
test, sometimes on unit tests, sometimes it does not hang and
completes successfully. As I said earlier, there were no problems
in April (when I started to use this awesome CI Server), May and
June. But after these monthes, there were too many build failures
caused by AppVeyor itself.</li>
</ol>
<p>Thanks in advance, here is the link - <a href=
"https://ci.appveyor.com/project/odinserj/hangfire-525">https://ci.appveyor.com/project/odinserj/hangfire-525</a></p></div>odinserjtag:help.appveyor.com,2012-11-13:Comment/344633882014-09-05T19:34:48Z2014-09-05T19:34:48ZConstant build failures<div><p>Hi Sergey,</p>
<p>Right, this is not good. Thanks for letting me know - I'm going
to see what's going on. Our #1 priorities right now are stability
and performance!</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/344633882014-09-11T03:29:28Z2014-09-11T03:29:28ZConstant build failures<div><p>Hi Sergey,</p>
<p>I spent some time this week trying to identify the cause of
failing builds of Hangifre.</p>
<p>At the first place I though it might be something with agent API
sporadically failing to send data to AppVeyor. However, running
<a href=
"https://github.com/FeodorFitsner/appvyr-xunit-tests/blob/master/xUnit-x64-Clr2/xUnit_x64_CLR2_Tests.cs">
simple tests with a lot of test cases</a> went smoothly.</p>
<p>Then I noticed that xUnit process consumes enormous amount of
memory while running tests in <code>Hangfire.Core.Tests.dll</code>
which was strange as these tests are basically in-memory tests and
don't talk to SQL or Redis or MSMQ. On my local machine xUnit
process took roughly 900 MB by the end (see attached
screenshot).</p>
<p>More interesting, when running the same tests in AppVeyor
environment and sending real-time test results memory consumption
is more severe - xUnit process takes all available memory and CPU
becomes 100% slowing the build down to zero - that's why it hits 30
minutes cap.</p>
<p>I gave it a try with ANTS Memory Profiler to see what's going
on. I think it's Moq and particularly Castle proxies are eating the
memory. See another screenshot attached.</p>
<p>Hope that helps.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/344633882014-09-12T14:54:17Z2014-09-12T14:54:17ZConstant build failures<div><p>Hi, Feodor! I'm really impressed with your investigation. It is
unbelievable for me to receive such feedback on a support issue,
especially from a busy man like you. You showed me the quality and
I very appreciate it.</p>
<p>I'm very ashamed that I didn't do it myself, and you are right,
the problem was related to Moq library's mock objects. I was not
aware that it creates a new instance for every mocked method
invocation instead of counting invocations in a grouped manner.</p>
<p>After fixing this all is working fine. Hope my project will not
eat project VMs anymore.</p></div>odinserj