Unplanned
Last Updated: 13 Jul 2021 07:34 by ADMIN
Create a Mock.Assert(); or a similar method that will verify all mock objects arranged for the current test method complies with the set expectation.
Planned
Last Updated: 29 Jun 2021 15:04 by ADMIN
Created by: Calvin
Comments: 2
Type: Bug Report
0

I filed a prior ThreadLeak:

Thread leak in JustMock (telerik.com)

 

I think I've found another one: (VS version 16.10.31321.278)

telerik_justmock_debugwindow_service_client!Telerik.JustMock.DebugWindow.Service.Client.ServiceHostMonitor.MonitorTimer_Elapsed

Apparently, the MonitorTimer_Elapsed code is running on a threadpool thread and it takes longer than 1 sec (perhaps it's waiting on a lock?).

Another timer tick occurs and the method is called again. Eventually, the ThreadPool runs out of threads and grows by about 1 thread per second (1Mb /sec leak)

In one dump 2Gig was used (1962 threads on the same MonitorTimer_Elapsed stack frame)

In that same dump there were 52 stacks with this frame:

telerik_justmock_debugwindow_service_client!Telerik.JustMock.DebugWindow.Service.Client.ConnectionSetupServiceClientBase`[[System.__Canon,mscorlib]].get_ServiceAvailable

(this was the same item as my prior report).

 

Unplanned
Last Updated: 02 Jun 2021 11:42 by ADMIN

The documentation on Fluent Mocking ends with this statement:

Important

Note that when you use Fluent Asserts only arrangements marked with either MustBeCalled or Occurs will be verified. For other tests you have to use the explicit assert.

What this fails to note is that, while this is true of the function "Assert", there is another function, "AssertAll", which will flag an error if any Arranged function call was not utilized.

 

On a related note, I left other suggestions for this same page a day or two ago.  I would have liked to leave the above statement using the same feedback utility, but I can no longer find the control that I used to leave those initial suggestions.

In Development
Last Updated: 31 May 2021 13:41 by ADMIN

The following test fails:

[TestMethod]
public void TestCallOrderWithInOrder()
{
	// Arrange
	var mockClass1 = Mock.Create<Class1>();
	var mockClass2 = Mock.Create<Class2>();

	Mock.Arrange(() => mockClass1.Method1())
		.InOrder();
	Mock.Arrange(() => mockClass2.Method1())
		.InOrder()
		.Occurs(2);
	Mock.Arrange(() => mockClass1.Method2())
		.InOrder();

	// Act
	mockClass1.Method1();

	mockClass2.Method1();
	mockClass2.Method1(); // <--- this call is not allowed by
						  //      InOrder clause currently 
						  //      and throws AssertFailedException

	mockClass1.Method2();

	// Assert
	Mock.Assert(mockClass1);
	Mock.Assert(mockClass2);
}

Unplanned
Last Updated: 26 May 2021 10:10 by ADMIN
String parameter "message" inside Mock.Assert APIs could be easily interpreted in the wrong way by associating them with the concrete assertion instead of the scope where this particular statement is taking place.
Unplanned
Last Updated: 18 May 2021 10:21 by ADMIN
JustMock Profiler prevents XAML Hot Reload and Visual Tree debugging functionalities. Disabling the profiler fixes the issue. This happens only for .NET Core WPF, under .NET Framework, everything runs as expected.
Unplanned
Last Updated: 17 May 2021 08:38 by ADMIN
Created by: Mihail
Comments: 0
Type: Feature Request
0
Integration with dotCover is only available through Telerik.JustMock.Configuration.exe, which works with the machine's registry and needs JustMock to be installed. This approach is not applicable to cloud-based build agents and therefore we need an integration that does not require the installation of JustMock.
Completed
Last Updated: 17 May 2021 08:10 by ADMIN
Trial period expiration disables the essential functionality inside JustMock extension menu, but there is no clear sign for the reason. This item is about improving this situation, by making the trial expiration explicitly and easily visible to the user.
Unplanned
Last Updated: 13 May 2021 08:42 by ADMIN

We are trying to run unit tests via xUnit and mocking method occurence using JustMockLite. Method under arrange is creating a underlying Task however, once in a while test fails with following error

 


build	11-May-2021 14:36:09	               Telerik.JustMock.Xunit.AssertFailedException : Multiple assertion failures:
build	11-May-2021 14:36:09	               1. Occurrence expectation failed. Expected exactly 1 call. Calls so far: 0
build	11-May-2021 14:36:09	         Arrange expression: x => x.CallAsync(IsAny(), IsAny())
build	11-May-2021 14:36:09	               2. Occurrence expectation failed. Expected exactly 1 call. Calls so far: 0
build	11-May-2021 14:36:09	         Arrange expression: x => x.NotifyAsync(IsAny())
build	11-May-2021 14:36:09	               
build	11-May-2021 14:36:09	               ---- Telerik.JustMock.Diagnostics.DebugViewDetailsException : State:
build	11-May-2021 14:36:09	         Elevated mocking: disabled
build	11-May-2021 14:36:09	         
build	11-May-2021 14:36:09	         Arrangements and expectations:
build	11-May-2021 14:36:09	                   Arrangement (id=0) x => x.Load(IsAny()):
build	11-May-2021 14:36:09	                 Met: Occurences must be in [1, 1]; calls so far: 1. 
build	11-May-2021 14:36:09	             Arrangement (id=1) x => x.InitializePolicy(IsAny(), IsAny()):
build	11-May-2021 14:36:09	                 Met: Occurences must be in [1, 1]; calls so far: 1. 
build	11-May-2021 14:36:09	             Arrangement (id=2) x => x.RequestBulkSync(IsAny(), IsAny(), IsAny()):
build	11-May-2021 14:36:09	                 Met: Occurences must be in [any, 1]; calls so far: 1. 
build	11-May-2021 14:36:09	             Arrangement (id=3) x => x.CallAsync(IsAny(), IsAny()):
build	11-May-2021 14:36:09	                 Unmet: Occurences must be in [1, 1]; calls so far: 0. 
build	11-May-2021 14:36:09	             Arrangement (id=4) x => x.NotifyAsync(IsAny()):
build	11-May-2021 14:36:09	                 Unmet: Occurences must be in [1, 1]; calls so far: 0. 
build	11-May-2021 14:36:09	         
build	11-May-2021 14:36:09	         Invocations:

In Development
Last Updated: 13 May 2021 07:49 by ADMIN

Using elevated mocking mode (profiler enabled) with long path names for the test containers (above 260 characters) causes the following command:

dotnet test

to fail with error:

Testhost process exited with error: Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(System.String[])
. Please check the diagnostic logs for more information.

Test Run Aborted.

Declined
Last Updated: 04 May 2021 13:27 by ADMIN
Created by: Doug
Comments: 1
Type: Bug Report
0

http://tv.telerik.com/watch/telerik/test-drive-your-code-with-justmock
https://stackoverflow.com/questions/5755413/typemock-vs-justmock-vs-rhinomock-moq-current-situation-in-2011?rq=1
i
s in a lot of webpages that point to whats good about just mock, except this link is broken, can you put in a redirect to the actual vids for just mock.

I currently use typemock, but looking for a team solution and having broken links and missing content implies product abandonment.

Where can I find the links to the current vid on just mock?

Thanks

Doug

 
Completed
Last Updated: 26 Apr 2021 09:48 by ADMIN

Attempt to use JustMock VSTest v.2 task to run the elevated mode tests with coverage when the "Test platform version" option is set to value "Installed by Tools Installer" fails with error:

Telerik.JustMock.Core.ElevatedMockingException: Cannot mock '<target type goes here>'. The profiler must be enabled to mock, arrange or execute the specified target.
Detected active third-party profilers:
* {9317ae81-bcd8-47b7-aaa1-a28062e41c71} (from process environment)
Disable the profilers or link them from the JustMock configuration utility. Restart the test runner and, if necessary, Visual Studio after linking.

Completed
Last Updated: 18 Mar 2021 13:28 by ADMIN
When the ports with which the DebugWindow should operate are changed in the DebugWindow host configuration the process is started with the default values instead of the new values.
Completed
Last Updated: 05 Mar 2021 14:19 by ADMIN
The exception description does not clearly state that there is an issue with the member which is a target of the mocking which could easily lead to confusion. Attached sample project reproducing the issue.
Completed
Last Updated: 10 Feb 2021 11:41 by ADMIN
Implement support for code coverage in the JustMock VSTest v.2 Azure Pipeline task similar to the code coverage option available in VS Test task.
Declined
Last Updated: 10 Feb 2021 11:10 by ADMIN

Having the following COM interop class

[ClassInterface(ClassInterfaceType.None)]
[Guid("86332C4E-0BDE-46EC-94C5-0A946C33C682")]
[TypeLibType(TypeLibTypeFlags.FCanCreate)]
public class MyComObjectClass : IMyComObject, MyComObject
{
    public MyComObjectClass();

    [DispId(1)]
    public virtual string Echo(string message);
}

and the sample class that uses it:

public class MyComObjectClassProxy
{
    public string Echo(string message)
    {
        IMyComObject itf = null;
        try
        {
            itf = new MyComObjectClass();
            return itf.Echo(message);
        }
        finally
        {
            if (itf != null)
            {
                Marshal.ReleaseComObject(itf);
            }
        }
    }
}

When I try to call the arranged constructor I am getting an error "Cannot create instances of type requiring managed activation", the unit test code:

[TestMethod]
public void TestMethod1()
{
    var mock = Mock.Create<MyComObjectClass>();
    Mock.Arrange(() => new MyComObjectClass()).Returns(mock);

    var sut = new MyComObjectClassProxy();
    var actual = sut.Echo("Message");

    Assert.AreEqual(string.Empty, actual);
}
Unplanned
Last Updated: 10 Feb 2021 10:47 by ADMIN
Created by: Toshio
Comments: 1
Type: Feature Request
0
An attempt to use future mocking fails. The attached sample demonstrates the issue.
Completed
Last Updated: 02 Feb 2021 09:35 by ADMIN

I have a class, which has a private async method, which has a local function, like the following example

 

internal class TestClass

{

 ......

        private async Task<bool> TestPrivateMethod()
        {
            var x = await TestLocalFunction();
            return x;

            async Task<bool> TestLocalFunction()
            {
                await Task.Delay(5);
                return true;
            }
 }

 

When I try to mock the local function, thows an error "System.MissingMemberException : C# 7 local function 'TestLocalFunction' with the given signature was not found inside method 'TestPrivateMethod'"

 

var testClassInstance = Mock.Create<TestClass>(Behavior.CallOriginal);

Mock.Local.Function.Arrange<Task<bool>>(testClassInstance, "TestPrivateMethod", "TestLocalFunction").Returns(Task.FromResult(true));

 

Completed
Last Updated: 02 Feb 2021 09:32 by ADMIN
Created by: Calvin
Comments: 7
Type: Bug Report
0

Thread leak in JustMock

I am a member of the Visual Studio Perf Reliability team

 

Recently, I’ve found several customer dumps with huge # of threads.

In this dump:

Watson : Cab Search (microsoft.com)

 

Thd_ThreadStack_telerik_justmock_debugwindow_service_client!Telerik.JustMock.DebugWindow.Service.Client.ConnectionSetupServiceClientBase`[[System.__Canon,mscorlib]].get_ServiceAvailable

2,136,997,888

 

Progress® Telerik® JustMock Feedback Portal

 

There are 2084 threads using 2G mem, most with the stack below:

This is caused by threadpool starvation: the JustMock call ties up a thread for more than 1 second, then another request comes in.

The CLR will create an additional thread after 1 second to satisfy the request. This keeps happening and creates thousands of threads, each with size 1Meg.

 


00 ntdll!NtWaitForMultipleObjects
01 KERNELBASE!WaitForMultipleObjectsEx
02 clr!WaitForMultipleObjectsEx_SO_TOLERANT
03 clr!Thread::DoAppropriateAptStateWait
04 clr!Thread::DoAppropriateWaitWorker
05 clr!Thread::DoAppropriateWait
06 clr!SOIntolerantTransitionHandler::SetNoException
07 clr!CLREventBase::WaitEx
08 clr!CLREventBase::Wait
09 clr!AwareLock::EnterEpilogHelper
0a clr!ThreadDebugBlockingInfo::PopBlockingItem
0b clr!DebugBlockingItemHolder::{dtor}
0c clr!AwareLock::EnterEpilog
0d clr!AwareLock::Enter
0e clr!AwareLock::Contention
0f clr!JITutil_MonReliableContention
10 Telerik_JustMock_DebugWindow_Service_Client!Telerik.JustMock.DebugWindow.Service.Client.ConnectionSetupServiceClientBase<Telerik.JustMock.DebugWindow.Service.Proxy.TraceEventsSubscriptionServiceProxy>.get_ServiceAvailable
11 Telerik_JustMock_DebugWindow_Service_Client!Telerik.JustMock.DebugWindow.Service.Client.SessionServiceClientBase<Telerik.JustMock.DebugWindow.Service.Proxy.MockRepositorySubscriptionServiceProxy>.KeepAliveTimer_Elapsed
12 System_ni!System.Timers.Timer.MyTimerCallback
13 mscorlib_ni!System.Threading.TimerQueueTimer.CallCallbackInContext
14 mscorlib_ni!System.Threading.ExecutionContext.RunInternal
15 mscorlib_ni!System.Threading.ExecutionContext.Run
16 mscorlib_ni!System.Threading.TimerQueueTimer.CallCallback
17 mscorlib_ni!System.Threading.TimerQueueTimer.Fire
18 mscorlib_ni!System.Threading.TimerQueue.FireNextTimers
19 mscorlib_ni!System.Threading.TimerQueue.AppDomainTimerCallback
1a clr!CallDescrWorkerInternal
1b clr!CallDescrWorkerWithHandler
1c clr!MethodDescCallSite::CallTargetWorker
1d clr!MethodDescCallSite::Call
1e clr!AppDomainTimerCallback_Worker
1f clr!ManagedThreadBase_DispatchInner
20 clr!ManagedThreadBase_DispatchMiddle::__l16::Cleanup::{dtor}
21 clr!ManagedThreadBase_DispatchMiddle
22 clr!ManagedThreadBase_DispatchOuter
23 clr!ManagedThreadBase_FullTransitionWithAD
24 clr!ManagedThreadBase::ThreadPool
25 clr!AppDomainTimerCallback
26 clr!ThreadpoolMgr::AsyncTimerCallbackCompletion
27 clr!UnManagedPerAppDomainTPCount::DispatchWorkItem
28 clr!ThreadpoolMgr::ExecuteWorkRequest
29 clr!ThreadpoolMgr::WorkerThreadStart
2a clr!Thread::intermediateThreadProc
2b kernel32!BaseThreadInitThunk
2c ntdll!__RtlUserThreadStart
2d ntdll!_RtlUserThreadStart

Completed
Last Updated: 02 Feb 2021 09:30 by ADMIN
Created by: Eric
Comments: 7
Type: Bug Report
0

when using JustMock Free in a net 5.0 app.  I am getting an Ninject exception that IAssemblyNameRetriever could not be found.  Looking at the code on github,

the NETCORE compile constant removes the line

AddComponent<IAssemblyNameRetriever, AssemblyNameRetriever>();

from StandardKernel.cs

however, CompiledModuleLoaderPlugin uses IAssemblyNameRetriever in it's constructor and

AddComponent<IModuleLoaderPlugin, CompiledModuleLoaderPlugin>();

is still included in the NETCORE version.

 

 

1 2 3 4 5 6