troubleshooting Question

Problem running xUnit tests inside a batch file when set in a scheduled task

Avatar of Christian Palacios
Christian PalaciosFlag for Canada asked on
Powershell* Packages* task schedulerXMLMicrosoft Visual Studio
4 Comments1 Solution216 ViewsLast Modified:
I'm not sure anyone can help since this is just a unique set up, but I'm hoping someone can shed some light on this issue.  I have a batch file that runs an MSBuild.exe command and then runs some xUnit tests using the xunit.console.x86.exe application.  I'm running five different commands similar to the one below.

C:\Users\sve\.nuget\packages\xunit.runner.console\2.4.1\tools\net472\xunit.console.x86.exe C:\SDS_IT\build\BuildTests\bin\Debug\BuildTests.dll -xml C:\xunit-test-results\build-test-result.xml

So the command runs some tests and then puts the output it an XML file.  If I run the batch file manually through a command window or through a PowerShell window, it runs fine every time.  But if I set a scheduled task to run this batch file, the task will successfully run two times in a row, but then on the third time, it hangs on the longest xUnit test.  I don't understand how it runs fine a couple of times and then it hangs on the third time.  I have tried this many times and this is always the case.  The scheduled task is set to run every hour.

Please let me know if you have an insight!  Ask any questions you may have!

Thanks in advance!
Christian Palacios
Senior IT Systems Administrator

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros