Cryptic error code from NUnitLauncher
External Program Failed: F:\TeamCityBuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe (return code was -1073740777)
I get the above error intermittently running Nunit with PatCover - can anyone tell me what return code -1073740777 means?
Thanks
Please sign in to leave a comment.
Could you please shed light on your configuration. How do you run unit tests. What .NET version is used to build your test assemblies, what .NET version is selected to run tests? Please have a look to the documentation page at http://confluence.jetbrains.net/display/TCD5/NUnit+Support
The problem is specific to once class that uses
WindowsImpersonationContext & uses a TearDown with the test method
I'm using NUnit 2.5.3 and have no problems with any other test/any build outside testing this class
Can't you at least tell me what the negative error code means?
Thanks
This negative error means that NUnit runner process crashed on startup. This could mean you try to load it under .NET framework or bitness that is not supported by the machine.
>> This could mean you try to load it under .NET framework or bitness that is not supported by the machine.
Could you rephase your reply - what does "bitness: mean - what does "load it under .Net framework" mean?
Thanks
David
.NET Frameworks could be .NET 1.1, .NET 2.0, .NET 4.0
Bitness could be x86, x64.
If you managed to select run configuration that is not supported by the machine, NUnit will definitly crash with such error.
Here's my best summation of the problem: it all boiled down to one Windows Secuiry test that did an explicit .net Dispose() on an object which internally used a [DllImport("advapi32.dll")]GetLoginA - The test itself was somewhat ill-conceived, and an alternate test which does a less "invasive" tear-down by calling undoImpersonation instead of the Dispose works fine
All's well that ends well...
Sadly, even with no Dispose, the same error has come back - almost every check in triggered build will fail with tests on my WindowsSecurity class. But if I manually run the same TeamCity build (press the "Run" button) right after the failure, there are no errors (all the tests run). And the tests always run locally on my PC. Perhaps some custom Finalize/Dispose code is needed in my class - the class is almost literally blocked copied from this post: http://stackoverflow.com/questions/1035116/using-advapi32-dlllogonusera-to-impersonate-a-remote-machines-local-user
Hope someone can help - I've spent the better part of a week trying to isolate/fix this.
The text below is from the TeamCity log when the build fails:
1) Note there are no details lines on the tests in CORE.Common.Test - just an 11s time summary
2) The NunitLauncher error appears to be part of the following CodeCoverage (using PartCover) - so it appears the just completed previous NUnit run on CORE.Common.Test left something in an unstable state
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.ConfigurationHelperTests.TestIsPublishServiceActive
[01:00:58]: [CORE.Common.Tests.ConfigurationHelperTests.TestIsPublishServiceActive] Test ignored: CORE.Common.Tests.ConfigurationHelperTests.TestIsPublishServiceActive
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.ConfigurationHelperTests.TestMethod1
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.ConfigurationHelperTests.TestMethod2
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.compareStringsTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.EnumerableToStringTest_List
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.EnumerableToStringTest_ListChar
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.EnumerableToStringTest_ListString
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.EnumerableToStringTest_ListStringChar
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ReplaceCharactersStringCharArrayCharTest
[01:00:58]: [CORE.Common.Tests.StringUtilTests.ReplaceCharactersStringCharArrayCharTest] Test ignored: CORE.Common.Tests.StringUtilTests.ReplaceCharactersStringCharArrayCharTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ReplaceCharactersStringStringCharTest
[01:00:58]: [CORE.Common.Tests.StringUtilTests.ReplaceCharactersStringStringCharTest] Test ignored: CORE.Common.Tests.StringUtilTests.ReplaceCharactersStringStringCharTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ReplaceIllegalUrlExtensionCharsStringCharTest
[01:00:58]: [CORE.Common.Tests.StringUtilTests.ReplaceIllegalUrlExtensionCharsStringCharTest] Test ignored: CORE.Common.Tests.StringUtilTests.ReplaceIllegalUrlExtensionCharsStringCharTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ReplaceIllegalUrlExtensionCharsStringTest
[01:00:58]: [CORE.Common.Tests.StringUtilTests.ReplaceIllegalUrlExtensionCharsStringTest] Test ignored: CORE.Common.Tests.StringUtilTests.ReplaceIllegalUrlExtensionCharsStringTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.StringUtilConstructorTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.StripHtmlTest
[01:00:58]: [CORE.Common.Tests.StringUtilTests.StripHtmlTest] Test ignored: CORE.Common.Tests.StringUtilTests.StripHtmlTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("michae_blackburn@gmail.com",True)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("jksdfa@kjlds",False)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("23michae+blackburn@gmail.com",False)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("michae-blackburn-@kjlsfdklj.com",False)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("michae-blackburn+@kjlsfdklj.com",False)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("michae-blackburn@kjlsfdklj.5om",False)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("michae-blackburn@kjlsfdkl23j.com",True)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("jkldsfa.jklsdfa@lkjfd.jlksfd@kjsdf.com",False)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("michae+blackburn@gmail.com",True)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("michae-blackburn",False)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.StringUtilTests.ValidateEmailTest("michael-blackburn@northwestern.edu",True)
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.cacheDocTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.HasRowsTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.ParseBadStringsToGuidTest("This is not a guid")
[01:00:58]: [CORE.Common.Tests.UtilTests.ParseBadStringsToGuidTest("This is not a guid")] [Test Output] 00000000-0000-0000-0000-000000000000
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.ParseBadStringsToGuidTest("00000000-0000-0000-0000-000000000000")
[01:00:58]: [CORE.Common.Tests.UtilTests.ParseBadStringsToGuidTest("00000000-0000-0000-0000-000000000000")] [Test Output] 00000000-0000-0000-0000-000000000000
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.ParseBadStringsToGuidTest("")
[01:00:58]: [CORE.Common.Tests.UtilTests.ParseBadStringsToGuidTest("")] [Test Output] 00000000-0000-0000-0000-000000000000
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.ParseDateTimeTest
[01:00:58]: [CORE.Common.Tests.UtilTests.ParseDateTimeTest] [Test Output] 967 0 6/24/2010 1:00:58 AM 6/24/2010
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.ParseIntTest
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.ParseStringToGuidTest
[01:00:58]: [CORE.Common.Tests.UtilTests.ParseStringToGuidTest] [Test Output] 00000000-0000-0000-0000-000000000000
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.TryParseBadStringsToGuidTest("")
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.TryParseBadStringsToGuidTest("00000000-0000-0000-0000-000000000000")
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.UtilTests.TryParseBadStringsToGuidTest("This is not a guid")
[01:00:58]: [CORE.Common.Test.dll] CORE.Common.Tests.WindowsSecurityTests.TestCheckIsAdminUser
[01:00:59]: [CORE.Common.Test.dll] CORE.Common.Tests.WindowsSecurityTests.TestCheckIsDifferentUser
[01:00:59]: [CORE.Common.Tests.WindowsSecurityTests.TestCheckIsDifferentUser] [Test Output] NUMSSWEB1\ServiceConfig NUMSSWEB1\ServiceConfig NT AUTHORITY\SYSTEM
[01:00:59]: [CORE.Common.Test.dll] CORE.Common.Tests.WindowsSecurityTests.TestConstructor
[01:00:59]: [CORE.Common.Test.dll] CORE.Common.Tests.WindowsSecurityTests.TestDisposableUndoesImpersonation
[01:00:59]: [CORE.Common.Test.dll] CORE.Common.Tests.WindowsSecurityTests.TestImpersonateAdminUser
[01:00:59]: [CORE.Common.Test.dll] CORE.Common.Tests.WindowsSecurityTests.TestImpersonateInvalidUser
[01:00:59]: [CORE.Common.Test.dll] CORE.Common.Tests.WindowsSecurityTests.TestImpersonateNullUser
[01:00:59]: [CORE.Common.Test.dll] CORE.Common.Tests.WindowsSecurityTests.TestMethod1
[01:00:59]: Tests run: 44, Errors: 0, Failures: 0, Inconclusive: 6 Time: 0.53125 seconds Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
[01:01:06]: ##teamcity[importData type='dotNetCoverage' tool='partcover' file='F:\TeamCityBuildAgent\temp\buildTmp\tmp5D7.tmp']
[01:01:07]: Importing data from 'F:\TeamCityBuildAgent\temp\buildTmp\tmp5D7.tmp' with 'dotNetCoverage' processor
[01:01:05]: [exec] [32609] [05980] CorProfiler is turned off
[01:01:05]: [exec] Target PageFaultCount: 33190
The problem may also be related to the login impersonation itself (running the test as some other admin person): i sometimes got this failure when the overall test suite didn't bomb but i wasn't undo-ing impersonation fast enough- the impersonated admin is NUMSSWEB1\\ServiceConfig vs. the "default" user "NT AUTHORITY\\SYSTEM"
WindowsSecurityTests.TestCheckIsDifferentUser (CORE.Common.Test.dll: CORE.Common.Tests)
Expected: "NUMSSWEB1\\ServiceConfig"
But was: "NT AUTHORITY\\SYSTEM"
Show stacktrace »
Expected: "NUMSSWEB1\\ServiceConfig"
But was: "NT AUTHORITY\\SYSTEM"
------------^ at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
at NUnit.Framework.Assert.AreEqual(Object expected, Object actual)
at CORE.Common.Tests.WindowsSecurityTests.TestCheckIsDifferentUser()
------- Stdout: -------
NUMSSWEB1\ServiceConfigNUMSSWEB1\ServiceConfigNT AUTHORITY\SYSTEM
could you please consider changing agent service running user name to some another local administrator. Does those tests pass if switch off code coverage? Will the result change is use NUnit commandline runner?
sorry for this to drag on, but I removed all the "suspect" tests centering around WindowsSecuriy - and the remaining tests still intermittently bomb - I have removed PartCover from the build and (so far)
I haven't had a build bomb - are other used occasionally getting my symtoms when using PartCover?
Thanks
As an alternative to using PartCover, I've just tried setting up NCover - using the exes supplied with Test
Driven.net
I get the following error when the code coverage starts - can you help tell me what I'm wrong
[exec] Waiting for profiled application to connect...Connected
path to NCoverExplorer: F:\NCoverExplorer\NCoverExplorer.Console.exe
I've reinstalled NCover
1.5.8 correctly (from an MSI) and NCover coverage now runs (hurray) BUT the output of dlls is ONLY for
JetBrains dlls - MY dlls (the ones NUnit runs) are missing
I've tried adding explicit assembles to profile and/or NCover Additional arguments (//a CORE.Common.Test;CORE.DAL.Test;CORE.Model.Test;CORE.Chart.Model) but this creates an empty coverage report (shows files: 0 in the NCoverExplorer Coverage Report)
please help - I'm so close, yet so far...
I can see from this previous thread taht this issue with Ncover profiling TeamCity vs. the app
has occured before:
Please try running tests with ANY MSIL keys for that process. For that case no child process should be created.
Jun 3, 2008
Oct 10, 2008 9:16 PM in response to: sean.gilbert
I figured it out. Set this option in the ncover task:
profiledProcessModule="JetBrains.TeamCity.PlatformProcessRunner.msil.exe"
Is there any way to do this without changing my existing Nant script to run NCover directly - i want to fo this by setting options for NCover directly in TeamCity
I changed my Nant script to use:
Please try running tests with ANY MSIL keys for that process. For that case no child process should be created.
[CITest] exec (34s)
Attachment(s):
NCoverTCStillNotWorking.JPG
Hello,
David, please _answer_ to all my quiestions. I will not be able to help you without detailed information on your setup.
What version of TeamCity do you use?
What .NET Framework version do you use? Do you compile your assemblies for x86, x64, MSIL?
Please attach build configuration settings screenshot(with all editors expanded) of the builds with PartCover
How had you set up NCover tests in NAnt?
How had you set up PartCover tests in NAnt?
Your test could pass on restart because of previous tests run. The previous tests run could leave some changes in the environment which made second run to pass without errors.
It seems you did not used TeamCity NCover 1.5 integration. I believe this information could be usefull for you:
TeamCity NUnitLauncher may start another processes to switch to the required .NET framework. Those processes are called
JetBrains.TeamCity.PlatformProcessRunner.*.exe. On the other hand, NCover/PartCover tools expectes that started
process will be the process to gather code coverage from. To make it work you should select proper JetBrains.TeamCity.PlatformProcessRunner.*.exe
from the list (see below) and start TeamCity NUnit runner in the following manner:
SELECTED_JetBrains.TeamCity.PlatformProcessRunner.***.exe MSIL ANY JetBrains.BuildServer.NUnitLauncher.exe ANY MSIL NUnit-2.4.8 <assemblies>
In NAnt TeamCity sets property ${teamcity.dotnet.nunitlauncher} with path to JetBrains.BuildServer.NUnitLauncher.exe.
There are several process runners to choose from:
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.msil.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.v4.0.msil.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.v4.0.x64.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.v4.0.x86.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.x64.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.x86.exe
Please attach full build logs of crashed builds (if any)
Thanks!
My work priorties have changed, so it may be a while before I can get back to you fully
We’re using TeamCity Pro 5.1, Nunit 2.5.3, partCover 2.3, .net 3.5 - Intermittently Builds will fail at the start of the coverage profiling with an NunitLauncher negative error number – there are no details as to what the problem is. Manually re-running the same build thereafter always works.
As an interim solution I’ve installed Ncover 1.5.8
But can you quickly advise me on how to change the following line from NAnt to get NCover coverage to cover my app - Thanks
<exec program="${teamcity.dotnet.nunitlauncher}" >
-----Original Message-----
From: Eugene Petrenko [mailto:devnet@jetbrains.com]
Sent: Friday, July 02, 2010 7:28 AM
To: David Laub
Subject: [General Topics] Cryptic error code from NUnitLauncher
David Laub,
A new message was posted in the thread "Cryptic error code from NUnitLauncher":
http://devnet.jetbrains.net/message/5266919#5266919
Author : Eugene Petrenko (eugene.petrenko)
Message:
--------------------------------------------------------------
Hello,
David, please _unserver_ to all my quiestions. I will not be able to help you without detailed information on your setup.
What version of TeamCity do you use?
What .NET Framework version do you use? Do you compile your assemblies for x86, x64, MSIL?
Please attach build configuration settings screenshot(with all editors expanded) of the builds with PartCover How had you set up NCover tests in NAnt?
How had you set up PartCover tests in NAnt?
Your test could pass on restart because of previous tests run. The previous tests run could leave some changes in the environment which made second run to pass without errors.
It seems you did not used TeamCity NCover 1.5 integration. I believe this information could be usefull for you:
TeamCity NUnitLauncher may start another processes to switch to the required .NET framework. Those processes are called JetBrains.TeamCity.PlatformProcessRunner.*.exe. On the other hand, NCover/PartCover tools expectes that started process will be the process to gather code coverage from. To make it work you should select proper JetBrains.TeamCity.PlatformProcessRunner.*.exe
from the list (see below) and start TeamCity NUnit runner in the following manner:
SELECTED_JetBrains.TeamCity.PlatformProcessRunner.***.exe MSIL ANY JetBrains.BuildServer.NUnitLauncher.exe ANY MSIL NUnit-2.4.8 <assemblies>
In NAnt TeamCity sets property ${teamcity.dotnet.nunitlauncher} with path to JetBrains.BuildServer.NUnitLauncher.exe.
There are several process runners to choose from:
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.msil.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.v4.0.msil.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.v4.0.x64.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.v4.0.x86.exe
${teamcity.dotnet.nunitlauncher}\..\JetBrains.TeamCity.PlatformProcessRunner.x64.exe
${teamcity.dotnet.nunitlauncher}\..\*JetBrains.TeamCity.PlatformProcessRunner.x86.exe*
Please attach full build logs of crashed builds (if any) Thanks!
Please have a look to the documentation page on NCover at
http://confluence.jetbrains.net/display/TCD5/NCover
Thanks - I did. I think the statement in the NCover 1.5 doc about using "x86" directly contradicts other statements in this thread to use "MSIL" - am I missing something?
You are right. NCover is only for x86 profiling, thus setting x86 is the right way.
Going back to x86 from MSIL makes no difference - NCover is still covering TeamCity,
not my app
attached is the screenshot for setting up NCover in TeamCity
below is my NUnit target in my Nant script
<target name="CITest" description="Run Unit Tests on Continous Integration build server" depends="build-tests">
<exec program="${teamcity.dotnet.nunitlauncher}" >
<arg value ="ANY" />
<arg value="x86" />
<arg value="NUnit-2.5.3" />
<arg value="${Site.build.dir}/bin/${DAL.out.name}.Test.dll" />
<arg value="${Site.build.dir}/bin/${Model.out.name}.Test.dll" />
<arg value="${Site.build.dir}/bin/${Charts.out.name}.Test.dll" />
<arg value="${Site.build.dir}/bin/${Common.out.name}.Test.dll" />
</exec>
</target>
Attachment(s):
NCover1.JPG
Please check in process explorer on the build agent how many proccesses are there under the build process.
What values were hidden under collapsed fields?
will do, as time permits