ConsoleRunner, nunit2 format xml blank test results
See original GitHub issueI’m upgrading our all automate tests to latest nunit, we have ~1100 selenium tests, during full build some of test results xmls’re empty and build fails.
$arguments = `"tests.dll`" --test=`"$testCase`" --work=$work --result=nunit-result-$i.xml;format=nunit2 --framework=net-4.5 --noheader --timeout=1500000 --domain=Multiple"
$process = $(Start-Process $nunit $arguments -PassThru)
When I use new (nunit3) format all xml’s are created as they should.
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (8 by maintainers)
Top Results From Across the Web
NUnit Test on Jenkins fail (nunit xml result file is empty )
I used to convert Nunit 3 result format to Nunit 2 format. "C:\NUnit 3.5.0\nunit3-console.exe" /result:\MyApplication.xml;format=nunit2 "D:\ ...
Read more >Unknown result format: nunit2 with Console runner 3.2.1
I haven't made any changes to the script that runs our NUnit tests but am receiving the following error from the NUnit3 console...
Read more >Console and Engine Release Notes
This is the first release of the NUnit Console Runner, nunit3-console.exe , which allows running of both .NET Framework and .NET Core tests,...
Read more >[JENKINS-32999] Failed to transform nunit3 TestResult.xml
ERROR: Step 'Publish NUnit test result report' aborted due to exception: hudson.util.IOException2: Could not transform the NUnit report.
Read more >Integrating with NUnit
On the same command prompt, execute the command below to run the NUnit tests in the project and save the results in JUnit...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great - thanks! Let’s close this issue for now, if anyone else is experiencing the same under he current master build, we can reopen.
Hi,
We’ve seen this too, we have several (~20) CI Servers running and we see it most often when the Virtual Machine Host (which hosts most of these CI Servers) is under extreme load (IE something kicked off the build).
We thought it was hardware, but this is the first attempt I’ve made to actually dig into NUnit source to see what’s going on and if there is maybe some type of race condition.
I feel I can add some additional information:
CheckWritability(string)
method, I’ve tested this by building a hacked up nunit-v2-result-writer.dll that has tons of additional logging.Things I’ve already tried:
WriteResultFile(XmlNode,string)
method as well as logic around when we enter intoWriteXmlOutput(XmlNode,XmlWriter)
HOWEVER I did not add any logic aroundWriteResultFile(XmlNode ,TextWriter)
What I can prove:
CheckWritability(string)
(I hacked it up to write out “this is just testing writability” instead of writing an empty file) but at least from what I have seen we never hitWriteXmlOutput(XmlNode,XmlWriter)
when we fail.Here’s where I am going next:
Here’s how we’re running the tests:
C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe @C:\BuildOutput\Temp\tmp1042.tmp
and here is the content of the tmp1042.tmp:
More background: These tests come from a time when we did not have parallel abilities, therefore they all need to be run sequentially, however as we’ve shifted some of our framework towards running in parallel we changed the runner to be NUnit 3 and just change the arguments (so for tests that we can run in parallel our “response file” is much larger with hundreds of test assemblies). But for the legacy stuff we simply call our logic to create a response file with a single test and a single agent and kick off nunit-console.
However this means that we have 100+ nunit-console instances starting up one right after another in very short order. (I’m sorry I know this is terrible, but its what we’re dealing with).
We only see this when the Virtual Host is under heavy load (all CI’s kick off) so there must be some race condition somewhere that is only getting exposed when the system becomes less responsive.
The tests that seem to fail (its always a different test assembly) are usually extremely small and most times because of the category actually have zero tests to execute, this is probably playing into this (the timing is just way tighter).
I am going to continue digging, but any pointers to where I might go next would be helpful.