Build/Test Issues

NCrunch fails to respond

Started by ray440 on 6,682 views

Some of my tests fail to respond when I change assertions (e.g. Assert.IsTrue(false))

Looking at the processing Queue shows this on the "Run Tests" line.

[14:16:29.4537-TestExecutionTask-33] ERROR (Internal): System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestRepository.#=qCUzbojIP475Ta93D1jObRJrJLWxH3_LYX1$zz1DSJ56iuN3BUgQtQAQ_7eYuClZY(IEnumerable`1 #=q1g7FSt7hXXax0vb_pS5H1Q==, IDictionary`2 #=qEvy89agmB2e_gRvNaIItiw==)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestRepository..ctor(IEnumerable`1 testsToRun)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.#=qGrRJ7gTK5_ax8EwKB8rrb4c2ZNSP_xrxnUqyktcDuPE=.#=q5PQXtKN44L40gg$2_ug00w==()
at #=qmdEAMK_c0wUkjl8QiR_0B$SqavkVGH8_WBLRdXnGACXX4ij_QGiQi6Yyi3LkqyId.#=qM5vw4cReHtB0oIZAADXisWrKqcIWrMteVT2lL5CSY$Y=(Action #=qQG$$IEqJNd7U57rti2oO0eMOr5L73KqDbcsBxL9FrLo=)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.RunTests(TestOutput output, IList`1 testsToRun, MasterExecutionMapSet masterMapSet)
at nCrunch.TestExecution.TestRunnerThread.#=qh9mHFD74qNv_qxnwJeExOA==(IMasterExecutionMap[] #=qk1TQlxFS2PvZulTUk4olrnb6ZWeHHkBAUGvy2pOCQ04=, IList`1 #=q_93JaZI9Uj9vyZ1g2aaI8Q==)

It looks as though you have multiple tests that are identifying themselves to NCrunch using the same name. What are the characteristics of the tests that seem to cause this? Are they [TestCase] tests or parameterized fixtures? Does the processing queue show NCrunch trying to run the same test multiple times within the same test task?
These seem to be two unrelated issues.

The exception does happen. All my tests and assemblies are unique...though after restarting a couple of times it no longer happens...

The other issue was some mishap/misunderstanding of what happens with catching exceptions in unit tests. For example, the following NUnit test written in f#:


[<Test>]
member this.``fails if name cannot be parsed``() =
try
let ne = make_NamedElement "very_badly_named_string"
Assert.IsTrue(false)
with
| e -> Assert.AreEqual(e.Message, "Bad name...")

This actually works now. But I got into a situation where the circle indicators were not correct.


Thanks - It sounds like some kind state related issue... If you have it happen again, would you be able to submit a bug report using the NCrunch menu? There have been a number of changes in the upcoming 1.36b that should fix issues like this, though it pays to be sure.

Cheers,

Remco

Post a reply

Log in to reply.