Nunit test working but not when in TeamCity

I have around 700 tests and they all work except 1. Outside TeamCity the test work. I can do the test on the same machine of Team City and it works but not when Team City execute the test.

Why?

The test use a singleton (static instance), do you test are done in parallel?

Where can I get some information to find out why this unit test fail in TeamCity but not in NUnit directly (When I use ReSharper inside the IDE the test works too)?

Thx

4 comments
Comment actions Permalink

Could you please check the user account that is running build agent service.
How does the test fail? Does it have any stacktrace? Does TeamCity NUnit test runner fail?

0
Comment actions Permalink

The test fail by having it's list cleared from the memory.

The failed test check if the list is empty (Assert) than fill up with the database some data, check if it's full. Erase all, and check if it's empty again. The problem is for this test the list is always empty. I know it's the the database connexion that is wrong because other database test works. More, the same test run perfectly well in Nunit on this computer.

StackTrace:
Test(s) failed.   (Cache error)Bookname should be TestName not :
Expected: True
But was:  False

at NUnit.Framework.Assert.That(Object actual, Constraint constraint, String message, Object[] args)
at NUnit.Framework.Assert.IsTrue(Boolean condition, String message, Object[] args)
at NUnit.Framework.Assert.IsTrue(Boolean condition, String message)
at XXXX.NunitTest.ZZZZZZ.GetSetWithPersistenceTest() in c:\svn\XXXXX\YYYYY\NunitTest\ZZZZZZ.cs:line 131

I am not sure what you are talking about if the runner fail, but other test after that works. So I guess the "runner" works?

0
Comment actions Permalink

Can test runnig order make this test failing?

0
Comment actions Permalink

I have try to do this test without the Static Facade (singleton) and it works. Is there a way that I can do all test 1 by1 without having them executing in same time? (At least it works without the singleton).

0

Please sign in to leave a comment.