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-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