Dynamics 365 for Operations 中的性能测试 - 无端点侦听

Performance testing in Dynamics 365 for Operations - no endpoint listening

简短的错误描述:

来自 PerfSDK 的

Ms.Dynamics.Performance.CreateUsers.exe 抛出 error

There was no endpoint listening at https://mytest.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message.

长错误描述:

我已经从 XML 记录创建了一个单用户 C# 测试,并且 运行 使用 PerfSDK 成功创建了它,如 PerfSDK and multiuser testing with Visual Studio Online[ 的第一部分所述=81=] 指导.

我在进行多用户负载测试时遇到了问题 运行,如实验第二部分所述。上面的 link 似乎是描述如何从单用户测试创建多用户测试以及如何在沙盒环境中使用 Visual Studio 在线 运行 它的唯一在线资源。我也看过一些视频,比如Tools to Measure and Improve Microsoft Dynamics AX Performance, Performance Tools之类的,但是其中none解释了所有需要采取的步骤,和上面的文章一样详细。

我做了以下事情:

  1. Dynamics 365 中使用任务记录器创建场景记录 对于操作.
  2. 使用 Visual Studio 中的记录创建了 C# 性能测试 PerfSDKSample 来自 PerfSDK 文件夹的项目。
  3. 遵循所有'步骤 运行 使用 Perf 进行单用户性能测试 SDK' 来自 article;
  4. 构建解决方案并成功 运行 我在测试资源管理器中的测试: Internet Explorer 打开开始并重播我的场景 已经录了

注意:我使用的是 DEV 环境 usnconeboxax1aos.cloud.onebox.dynamics.com for testing. When I tried using another hostname in CloudEnvironment.Config (a sandbox, e.g. mysandbox.sandbox.operations.dynamics.com),单用户测试失败并显示以下 错误消息:

System.TypeInitializationException: The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception. ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://mysandbox.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: The remote server returned an error: (404) Not Found..

  1. 为了多用户测试,我从 Visual Studio 启动了 Visual Studio 在线门户 https://app.vssps.visualstudio.com/profile/view
  2. 我修改了TestSetup方法如下:

单用户测试设置:

public void TestSetup()
{
    SetupData();
    _userContext = new UserContext(UserManagement.AdminUser);
    Client = DispatchedClient.DefaultInstance;
    Client.ForceEditMode = false;
    Client.Company = "GB01";
    Client.Open();
}

多用户测试设置:

public void TestSetup()
{
    var testroot = System.Environment.GetEnvironmentVariable("DeploymentDir");
    if (string.IsNullOrEmpty(testroot))
    {
        testroot = System.IO.Directory.GetCurrentDirectory();
    }
    Environment.SetEnvironmentVariable("testroot", testroot);
    if (this.TestContext != null)
    {
        timerProvider = new TimerProvider(this.TestContext);
    }
    SetupData();
    _userContext = new UserContext(UserManagement.AdminUser);
    Client = new DispatchedClientHelper().GetClient();
    Client.ForceEditMode = false;
    Client.Company = "GB01";
    Client.Open();
}
  1. 我将 CloudEnvironment.Config 中的主机名设置为沙箱 URL 例如mysandbox.sandbox.operations.dynamics.com.
  2. 登录到沙盒机器并安装了我之前为单用户测试生成的证书。
  3. 在沙盒机器上更新 wif.config 与之前在 DEV 中更新的方式相同,并重新启动 IIS。
  4. 在解决方案资源管理器中双击 vsonline.testsettings 并使用上面 article 中推荐的设置(相应地针对我的证书和测试场景进行了修改)。
  5. 从 Solution Explorer 打开 SampleLoadTest.loadtest 并将其调整为仅在 Test Mix 节点中使用我的测试,减少了测试持续时间和用户数量。
  6. 运行负载测试。

负载测试以一些错误结束。第一个TestError同上:

Initialization method MS.Dynamics.Performance.Application.TaskRecorder.GenJnlBase.TestSetup threw exception. System.TypeInitializationException: System.TypeInitializationException: The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception. ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://mysandbox.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: The remote server returned an error: (404) Not Found..

  1. 最后,即使我能够在我的 DEV 机器上 运行 Ms.Dynamics.Performance.CreateUsers.exe 成功(在 usnconeboxax1aos.cloud.onebox.dynamics.com 中创建了许多测试 AX 用户),当沙盒环境 URL 在 CloudEnvironment.Config 中设置,Ms.Dynamics.Performance.CreateUsers.exe 失败并出现相同的 错误 :

C:\PerfSDK>Ms.Dynamics.Performance.CreateUsers.exe 3 GB01 Failed with the following error: System.TypeInitializationException: The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception. ---> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://mytest.sandbox.operations.dynamics.com/Services/AxUserManagement/Service.svc/ws2007FedHttp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ... Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at MS.Dynamics.TestTools.CloudCommonTestUtilities.AxUserManagementServiceReference.IAxUserManagement.EnumUsers() at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement.PopulateAxUsers() at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement..cctor() --- End of inner exception stack trace --- at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement.get_AdminUser() at MS.Dynamics.Performance.CreateUsers.Program.Main(String[] args)

根据 walkthrough

If you have an ARR-enabled environment, i.e. you have 2 endpoints like this:

  • apr-arr8aossoap.axcloud.test.dynamics.com
  • apr-arr8aos.axcloud.test.dynamics.com

You would need to enter both endpoints in CloudEnvironment.Config

no endpoint listening 错误可以通过指定正确的 SOAP 主机名来解决,例如

<ExecutionConfigurations Key="HostName" Value="mysandbox.sandbox.operations.dynamics.com" />
<ExecutionConfigurations Key="SoapHostName" Value="mysandboxaossoap.sandbox.operations.dynamics.com" />