chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
We had to rollback Isolator on our build server back to version 5.4.5 because of the following problem:

1. Ugraded to Isolator 6.0.1 (also tried 6.0, same problem)
2. Developers' machines work fine, but developers don't have NCover 3.0 installed.
3. On a build machine we run a build that is triggered from CruiseControl.NET and includes full build followed by unit test execution with code coverage report generation.
4. Once the unit tests execution is complete for the first project, the build hangs forever at the point when it is supposed to generate code coverage report. Report is not generated.
5. Switching to Isolator 5.4.5 fixes the problem.

CruiseControl.NET has the following text in its log:

*** Internal Error mocked value not found
at de.a(...)
at de.a(...)
at TypeMock.MockManager.a(...)
at TypeMock.InternalMockManager.getReturn(...)
at System.ComponentModel.Component.Dispose(...)

In case we run the build without collecting code coverage, everything works fine.
asked by vagif (19.4k points)

16 Answers

0 votes
Hello,

sorry it took me a while to respond, I'm trying to reproduce the issue here, however there are some missing dependencies.
I notice here in the code that you're using the Unity container. Are you also using the Entity Framework?

Would it be possible for you to send a small reproduction project to support at typemock.com? That could be a great help.

Thanks!
answered by igal (5.7k points)
0 votes
Hi,

I notice here in the code that you're using the Unity container. Are you also using the Entity Framework?


No, currently we're using our own wrapper over EntLib DAAB

Would it be possible for you to send a small reproduction project to support at typemock.com? That could be a great help.


Yeah! Finally I did it! It looks like a heisenbug to me... It seems to depend on test run time or something like that. I really hope it will help. Sent to support
answered by 3ter (2.5k points)
0 votes
All right... Time passed, now I've got over 6000 tests now and this bug became very annoying.
Every nightly build fails now with at least one "***Internal..." but now I can say about the error pattern: it always happens in LINQs.
For example, from today's build I've got following broken test (here is one but I've got 6 tests failed with "***Internal...")
[TestMethod]
[IntegrationTest]
public void IntegrationTest_GetGeoTypes()
{
   #region Expected Result

   IList<GeoType> expectedResult = new List<GeoType>()
   {
      new GeoType()
      {
         Id = 13,
         Name = "name1",
         Scope = 3
      },

      new GeoType()
      {
         Id = 23,
         Name = "name2",
         Scope = 4
      }
   };

   #endregion

   string userName = "IntegrationTest_GetSegmentDescription";
   AddressManagementDBAccessor accessor = new AddressManagementDBAccessor();

   IList<GeoType> actualResult;
   using (SessionProxy session = IntegrationTestsDBConnection.GetSessionForIntegrationTest()) -- session is mocked here
   {
      session.Open(System.Data.IsolationLevel.ReadCommitted, userName);
      actualResult = accessor.GetGeoTypes(session);
   }

   //Verify
   VerifyHelpers.CheckValues<GeoType>(expectedResult[0], actualResult.Where(entity => entity.Id == 13).Single(), "13"); -- Fails here
   VerifyHelpers.CheckValues<GeoType>(expectedResult[1], actualResult.Where(entity => entity.Id == 23).Single(), "23");
}

Test method Wumte.Server.Common.UnitTests.AddressManagementDBAccessorTest.IntegrationTest_GetGeoTypes threw exception:

TypeMock.TypeMockException:
*** Internal Error mocked value not found

dq.a()
dq.a(Object A_0, String A_1, String A_2, MethodBase A_3, Object[] A_4, Object A_5)
Wumte.Server.Common.UnitTests.AddressManagementDBAccessorTest.<IntegrationTest_GetGeoTypes>b__17(GeoType entity) in c:BuildRootBifrostAndvari NightlySourcesWumte.Server.Common.UnitTestsAddressManagementDBAccessorTest.cs: line 172
System.Linq.Enumerable.WhereListIterator`1.MoveNext()
System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
Wumte.Server.Common.UnitTests.AddressManagementDBAccessorTest.IntegrationTest_GetGeoTypes() in c:BuildRootBifrostAndvari NightlySourcesWumte.Server.Common.UnitTestsAddressManagementDBAccessorTest.cs: line 172
TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Boolean A_5, Object[] A_6)
TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected, Boolean isInterceptedType)
Wumte.Server.Common.UnitTests.AddressManagementDBAccessorTest.IntegrationTest_GetGeoTypes() in c:BuildRootBifrostAndvari NightlySourcesWumte.Server.Common.UnitTestsAddressManagementDBAccessorTest.cs: line 138


VerifyHelpers.CheckValues is method which we wrote for comparing expected and actual collections:
public static void CheckValues<TResult>(TResult expected, TResult actual, string id, params string[] ignore)
{
   Assert.IsNotNull(expected, "expected value is null");
   Assert.IsNotNull(actual, "actual value is null");

   var properties = EntityHelper.GetSimpleProperties<TResult>()
      .Where(property => !ignore.Contains(property.Name, new EqualityComparerFunc<string>((str1, str2) => string.Equals(str1, str2, StringComparison.InvariantCultureIgnoreCase))));

   /*System.Diagnostics.Debug.WriteLine(string.Empty);
   System.Diagnostics.Debug.WriteLine(string.Format("CheckValues<0>", typeof(TResult)));*/
   foreach (var property in properties)
   {
      /*System.Diagnostics.Debug.WriteLine(string.Format("Name {0} expected {1} actual {2}", property.Name, property.GetValue(obj1, null), property.GetValue(obj2, null)));*/
      Assert.AreEqual(property.GetValue(expected, null), property.GetValue(actual, null), "Entity " + typeof(TResult) + " id[" + id + "]: " + property.Name);
   }
}

The main problem is the exception occures when there are a lot of tests in test-run. I can't reproduce it running only this test but in test-run of 6000 tests this one fails almost every time
BTW - why Isolator is wrapping something in LINQ methods I don't mock?
Isolator 6.0.10
Thanks in advance
answered by 3ter (2.5k points)
0 votes
Hi,
Can you please download the newest version? we did some changes there so it might fix this problem. In any case, the Internal... exception changed so it should provide more information to help us debug this.
answered by yoel (1.9k points)
0 votes
Hi,

Can you please download the newest version? we did some changes there so it might fix this problem. In any case, the Internal... exception changed so it should provide more information to help us debug this.


Hi Yoel,

Could you please confirm what version this has been modified in? I'm intermittently getting this error in version 6.0.8.

Thank you for your time.
answered by dblack (8.4k points)
0 votes
Hi Dave,

We dealt with this bug twice in the past , the last time was in the current version (7.0.6) so it'd be great if you could install and run it.
The problem with it is that it seems to come and go randomly thus it can't be reproduces nor tested.
Please let us know if 7.0.6 solved it for you.
answered by alex (17k points)
...