XUnit Tests Not Finishing
I recently updated my project to VS2015. I also recently updated
to XUnit 2.0 (from 2.0 beta). My jobs are stalling out when running
tests, as seen here:
https://ci.appveyor.com/project/Zoltu/repocreator/build/51
Looking at the tests tab, I can see that most of my tests ran fine and passed, but there are 3 each time that get stuck. Normally, I would assume that this was a problem with my tests but when I run them with the exact same command locally they work fine:
C:\Users\Micah\Source\RepoCreator>packages\xunit.runner.console.2.0.0\tools\xunit.console.x86 "Tests\bin\Release\Zoltu.RepoCreator.Tests.dll" -appveyor
xUnit.net console test runner (32-bit .NET 4.0.30319.42000)
Copyright (C) 2015 Outercurve Foundation.
Discovering: Zoltu.RepoCreator.Tests
Discovered: Zoltu.RepoCreator.Tests
Starting: Zoltu.RepoCreator.Tests.DLL
Zoltu.RepoCreator.Tests.GitHubTests.create_repo_with_replacements [SKIP]
Not implemented yet.
Finished: Zoltu.RepoCreator.Tests.DLL
=== TEST EXECUTION SUMMARY ===
Zoltu.RepoCreator.Tests.DLL Total: 14, Errors: 0, Failed: 0, Skipped: 1, Time: 7.079s
My only guess is that it has something to do with whatever the
-appveyor command line switch does or that there is
some difference in the environment from my local environment.
Has anyone else run into this problem?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac

1 Posted by micah on 02 Aug, 2015 07:07 PM
In case it matters, one of the tests it is failing on connects to GitHub. Are the tests run behind a firewall of any kind?
Support Staff 2 Posted by Feodor Fitsner on 02 Aug, 2015 07:17 PM
There is no firewall - any kind of outbound traffic is allowed. What resource/URL do you request? Did it work before?
- Feodor
3 Posted by micah on 02 Aug, 2015 07:25 PM
It worked before upgrading to VS2015 and updating my xunit to 2.0 (from beta). It hits the GitHub API. Disabling the integration test doesn't appear to have resolved the issue, it just moves the problem to another test (that is a unit test, no external dependencies).
Support Staff 4 Posted by Feodor Fitsner on 02 Aug, 2015 08:16 PM
OK, in order to check if the issue is connected to AppVeyor real-time logging you may try disabling it.
1) Copy console runner execution command from build log, disable tests auto-discovery and use script instead with original command and
-appveyorswitch removed.2) remove
APPVEYOR_API_URLenvironment variable inbefore_test: likeAlso, you may want to check your tests locally on a build worker via RDP: http://www.appveyor.com/docs/how-to/rdp-to-build-worker
5 Posted by micah on 02 Aug, 2015 08:25 PM
The RDP thing answered the question immediately. My test asserted apparently (rather than throwing an exception). It appears to be an issue with code contracts on my assembly under test:
I can probably troubleshoot this specific problem from here, though it would be nice if an assertion was somehow propagated to the build output (this may not be possible). Would have saved me quite a bit of time troubleshooting.
Support Staff 6 Posted by Feodor Fitsner on 02 Aug, 2015 08:31 PM
Great, thanks for the update!
You may want to submit an issue to xUnit project.
7 Posted by micah on 02 Aug, 2015 08:32 PM
It appears that the VS2015 build image doesn't have code contracts installed. Can this be added to the build image?
I am assuming that is the problem since when I build with
os: Visual Studio 2015my tests throw this assertion and I don't see the Code Contracts stuff running in the build output like I do onWindows Server 2012 R2.Support Staff 8 Posted by Feodor Fitsner on 02 Aug, 2015 08:34 PM
Sure, code contracts for VS 2015 will be installed: https://github.com/appveyor/ci/issues/346
Support Staff 9 Posted by Feodor Fitsner on 02 Aug, 2015 08:35 PM
As a workaround for now you can use this simple script to install them during the build: https://gist.github.com/FeodorFitsner/9769cb61790387005445
10 Posted by micah on 02 Aug, 2015 08:41 PM
Thanks!
micah closed this discussion on 02 Aug, 2015 08:41 PM.