tag:help.appveyor.com,2012-11-13:/discussions/problems/4434-build-hangs-during-nunit-testsAppVeyor: Discussion 2018-10-19T08:17:48Ztag:help.appveyor.com,2012-11-13:Comment/395786882016-04-06T13:26:54Z2016-04-06T13:26:54ZBuild hangs during NUnit tests<div><p>Hi Anthony,<br>
Can you please give me a name of one of those tests that hang or is
it possible for you to make the simplest repro branch with just a
single test in it?</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395786882016-04-06T13:34:08Z2016-04-06T14:13:44ZBuild hangs during NUnit tests<div><p>Hi Feodor, thanks for the quick response.</p>
<p>In the linked build, <a href="https://ci.appveyor.com/project/justeattech/justsaying/build/3.0.410">
https://ci.appveyor.com/project/justeattech/justsaying/build/3.0.410</a>
the last test "WhenPassingAHandledAndUnhandledMessage" is the one
that hangs.<br>
However tests above that should all log messages that say<br>
"Starting Listening Stopping Listening<br>
[RanToCompletion] Stopped Listening "</p>
<p>Note that several of them do not log stop messages when run in
appveyor.</p>
<p>Our best guess right now is that the important difference is
that appveyor build machines have one core, and this somehow means
that the listen loop's CancellationToken is never successfully
set.</p>
<p>Is there a way to replicate that on my usual 8-core machine?</p></div>anthony.steeletag:help.appveyor.com,2012-11-13:Comment/395786882016-04-06T17:46:18Z2016-04-06T17:46:18ZBuild hangs during NUnit tests<div><p>Do you know that method with async...await that making it
hang?</p>
<p>I'm pretty sure it's because of single CPU core. There was a
similar issue, but for xUnit: <a href="http://help.appveyor.com/discussions/problems/4384-build-not-completing-ever-stuck-running-microsoftaspnettesthost-integration-tests#comment_39519769">
http://help.appveyor.com/discussions/problems/4384-build-not-comple...</a>
which was resolved by correct test implementation.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395786882016-04-06T18:18:52Z2016-04-06T18:24:15ZBuild hangs during NUnit tests<div><p>Yeah sure. We've been around these tests for weeks, nothing
obviously wrong.<br>
I've seen that link before.<br>
This is far from our first async code and we never call .Result on
a task. If we can't replicate it, how can we debug it? It passes
everywhere except on appveyor.</p>
<blockquote>
<p>Do you know that method with async...await that making it
hang?</p>
</blockquote>
<p>Sorry, don't quite understand the question, what are you
asking?</p>
<p>Do you still want a cut-down version of the project with just
enough to make it fail?</p></div>anthony.steeletag:help.appveyor.com,2012-11-13:Comment/395786882016-04-06T18:47:24Z2016-04-06T18:47:24ZBuild hangs during NUnit tests<div><p>Yes, it would be very helpful to have a cut-down version with
one-two tests just to play around this problem. Thank you!</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395786882016-04-06T20:55:03Z2016-04-06T20:55:03ZBuild hangs during NUnit tests<div><p>Thanks. I have a branch here which is much cut-down <a href="https://github.com/AnthonySteele/JustSaying/tree/minimum_viable_bug">
https://github.com/AnthonySteele/JustSaying/tree/minimum_viable_bug</a></p>
<p>It's not that small yet, I might still work on that branch in
the next few days.<br>
Note that in my experience, you can't cut it down to "1-2 tests".
it takes 4-5 tests.</p>
<p>As I said before, the tests should all output line
containing<br>
"Starting Listening Stopping Listening<br>
[RanToCompletion] Stopped Listening "</p>
<p>But only the first one does, and it doesn't matter which one is
first. After several tests have failed to log the "complete"
message, it hangs.</p>
<p>Here is a hanging build: <a href="https://ci.appveyor.com/project/justeattech/justsaying/build/3.0.416">
https://ci.appveyor.com/project/justeattech/justsaying/build/3.0.416</a></p></div>anthony.steeletag:help.appveyor.com,2012-11-13:Comment/395786882016-04-07T13:12:46Z2016-04-07T13:26:28ZBuild hangs during NUnit tests<div><p>I have managed to work out what the test issues were. This was
harder than normal as there were several issues that did not occur
anywhere but appveyor, and no useful output came from appveyor.</p>
<p>These issues seem to have been due to<br>
- appveyor build machines are much slower than other machines used
for test, which means that we encountered timeouts there that we
did not encounter anywhere else, causing conditions that lead to...
- appveyor build machines are the only single core machines that we
encounter, and on these it is easier to deadlock threads - lack of
output or ability to reproduce the issue made it hard to debug</p>
<p>Thanks for the input on this</p></div>anthony.steeletag:help.appveyor.com,2012-11-13:Comment/395786882016-04-07T18:10:51Z2016-04-07T18:10:51ZBuild hangs during NUnit tests<div><p>Great, thanks for the update!</p>
<p>I think making your tests running on a single core is a good
thing as final software could be easily deployed by customers to
"small" or "micro" cloud instances (Azure, AWS, etc.) with a single
core. I understand though we all have powerful "i7" development
machines where those potential deadlocks is not a problem.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/395786882016-04-12T12:13:12Z2016-04-12T12:13:12ZBuild hangs during NUnit tests<div><p>All through, though since the appveyor machines are quite
different to most others, there are going to be issues that surface
for the first time under test on appveyor. In effect, we will need
to debug for this case on appveyor.</p></div>anthony.steele