1

我们有一个非常大的自动化套件,需要大量时间才能运行。这些是 Windows 应用程序的 UI 测试,我们使用 LeanFT 和 NUnit。S 这不是网络,我们还没有任何类型的并行/网格解决方案启动和运行。

整个套件有大约 110 个测试,所有测试都在一个代理上运行。大约 80% 的时候,测试运行随机断开连接,我们看到了这个错误

Error Details
Runtime Error
HP.LFT.SDK.GeneralLeanFtException: Channel was disconnected
   at HP.LFT.SDK.Core.ClassModel.TestObjectExecuterBase.HandleReplayError(Int32 errorCode, IDictionary`2 data)
   at HP.LFT.SDK.Core.Communication.CommunicationClient.HandleError(Action`2 onError, Int32 status, IDictionary`2 data)
   at HP.LFT.SDK.Core.Communication.CommunicationClient.Send(String messageType, IDictionary`2 data, Action`2 onError)
   at HP.LFT.SDK.Core.ClassModel.TestObjectExecuter.ExecuteMethod[TResult](String methodName, Object[] arguments)
   at HP.LFT.SDK.Core.ClassModel.TestObjectBase.ExecuteMethod[TResult](String methodName, Object[] arguments)
   at HP.LFT.SDK.OperationExecutionWrapper.ExecuteWithEventsInternally[T](ITestObject testObject, Object additionalInfo, Func`1 innerAction, MethodBase methodInfo, Boolean reportOnlyOnError, Object[] arguments)
   at HP.LFT.SDK.OperationExecutionWrapper.ExecuteWithEvents[TR](Func`1 innerAction, Func`1 originalMethod, Boolean reportOnlyOnError, ITestObject testObject, Object additionalInfo)
   at HP.LFT.SDK.UiObjectBase.get_IsVisible()

测试套件中间出现运行时错误的原因可能是什么?有没有其他人在使用这个框架扩展他们的测试自动化时遇到过类似的事情?谢谢!

这是另一个堆栈跟踪,来自初始断开连接。这是在 hpe.leanft.runtime 日志文件中找到的

[2018-07-11 12:50:47.189] [INFO] ChannelHelper - Channel close. ChannelId:0
[2018-07-11 12:50:47.190] [INFO] ChannelHelper - _cleanPendingRequests: Called
[2018-07-11 12:50:47.195] [INFO] WSCommunicationChannel - _onClose : Disconnected from  ws://localhost:53500
[2018-07-11 12:50:47.195] [INFO] LightWeight.Dispatcher - onDisconnect: disconnected from  { target: 'LftRuntime' }
[2018-07-11 12:50:47.197] [INFO] LightWeight.Dispatcher - disconnected from NativeRuntime!
[2018-07-11 12:50:47.197] [INFO] LightWeight.Dispatcher - NativeRuntime is down!, exiting...
[2018-07-11 12:50:47.197] [INFO] LicenseManager - onBeforeClose: releasing license
[2018-07-11 12:50:47.198] [WARN] Engine.ChannelManager - Exception when sending to client Error TypeError: Cannot read property 'send' of null
    at Object.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_communication_channel.js:149:35)
    at ChannelManagerBase.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\channels-base.js:63:32)
    at Dispatcher.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:175:40)
    at LftLicenseManager.onBeforeClose (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\license_manager.js:151:32)
    at C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\dispatcher-base.js:44:20
    at Array.map (native)
    at DispatcherBase.notifyDispatcherEvent (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\dispatcher-base.js:43:40)
    at Dispatcher._closeProcess (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:257:37)
    at Dispatcher.onLftRuntimeDown (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:249:14)
    at Dispatcher.onDisconnect (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:126:18)
TypeError: Cannot read property 'send' of null
    at Object.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_communication_channel.js:149:35)
    at ChannelManagerBase.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\channels-base.js:63:32)
    at Dispatcher.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:175:40)
    at LftLicenseManager.onBeforeClose (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\license_manager.js:151:32)
    at C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\dispatcher-base.js:44:20
    at Array.map (native)
    at DispatcherBase.notifyDispatcherEvent (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\dispatcher-base.js:43:40)
    at Dispatcher._closeProcess (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:257:37)
    at Dispatcher.onLftRuntimeDown (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:249:14)
    at Dispatcher.onDisconnect (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:126:18)
[2018-07-11 12:50:47.200] [INFO] LicenseManager - got disconnected from  LftRuntime
[2018-07-11 12:50:47.200] [INFO] LicenseManager - marking license as invalid
[2018-07-11 12:50:47.201] [INFO] SessionManager - onClientDisconnected: eventInfo: { client: { target: 'LftRuntime' }, additionalInfo: {} }
[2018-07-11 12:50:47.203] [INFO] SessionManager - going to send session closes event
[2018-07-11 12:50:47.210] [INFO] ChannelHelper - Channel close. ChannelId:0
[2018-07-11 12:50:47.210] [INFO] ChannelHelper - _cleanPendingRequests: Called
[2018-07-11 12:50:47.212] [INFO] ChannelHelper - _cleanPendingRequests: Still have pending requests going to notify an error
[2018-07-11 12:50:47.213] [WARN] PackagesManager.ChannelManager - Error when sending to client Error { Error: Channel was disconnected
    at Object.<anonymous> (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:191:37)
    at Array.forEach (native)
    at Object._cleanPendingRequests (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:185:29)
    at Object._onClose (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:212:14)
    at emitTwo (events.js:106:13)
    at WebSocket.emit (events.js:191:7)
    at WebSocket.cleanupWebsocketResources (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\ws\lib\WebSocket.js:950:8)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1277:8) status: -602 }
Error: Channel was disconnected
    at Object.<anonymous> (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:191:37)
    at Array.forEach (native)
    at Object._cleanPendingRequests (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:185:29)
    at Object._onClose (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:212:14)
    at emitTwo (events.js:106:13)
    at WebSocket.emit (events.js:191:7)
    at WebSocket.cleanupWebsocketResources (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\ws\lib\WebSocket.js:950:8)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1277:8)
[2018-07-11 12:50:47.213] [INFO] WSCommunicationChannel - _onClose : Disconnected from  ws://localhost:53500
[2018-07-11 12:50:47.214] [INFO] Dispatcher - onDisconnect: disconnected from  { target: 'LftRuntime' }
[2018-07-11 12:50:47.216] [WARN] Engine.ChannelManager - send: received error from:  PackageManager_1

此外,在我得到上面的日志之前,我看到了数百个这样的

[2018-07-11 12:50:29.173] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:31.755] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:32.686] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:33.605] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:33.765] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:33.976] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:34.234] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:34.494] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:37.769] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:38.127] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:38.373] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:38.769] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:39.115] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:41.231] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
[2018-07-11 12:50:42.048] [ERROR] PackageManager - executeCommandInner: top test object has no cookie
4

0 回答 0