1

We have a very large automation suite that takes a good bit of time to run. These are UI tests for a windows app, and we use LeanFT & NUnit. S it is not web we do not yet have any sort of parallel/grid solution up and running.

The whole suite has around 110 tests and all are ran on a single agent. Around 80% of the way, the test run randomly disconnects & we see this error

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()

What might be the causes of a Runtime error in the middle of a test suite? Has anyone else experienced something similar when scaling up their test automation using this framework? Thanks!

Here is another stack trace, from the initial disconnect. this was found in the hpe.leanft.runtime log file

[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

In addition i see several hundreds of these right before i get the log above

[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
Tree55Topz
  • 1,102
  • 4
  • 20
  • 51
  • Hmm what is the stacktrace of that *No more threads...* exception? You can find it in the runtime logs from `%LOCALAPPDATA%\Hewlett-Packard\LeanFT\Logs` folder – Adelin Mar 08 '18 at 06:32
  • @Adelin we are still running into this issue. I did not see the thread message, but I think if we can figure out why we are getting disconnected it should be alright. I updated my answer with a chunk from the logs today. One test initially fails with HP.LFT.SDK.GeneralLeanFtExpception : Channel was disconnected and then all others fail quickly with a HP.LFT.Communications.SocketClient.CommunicationException : Send: Clent is not connected – Tree55Topz Jul 11 '18 at 17:22
  • @Adelin nevermind.. these logs i do not think will help you.. it was from an earlier time today. I do not see anything from when i ran the tests that might suggest an issue :( – Tree55Topz Jul 11 '18 at 17:24
  • @Adelin Ok, I think I was able to find some valuable logs in the hpe.leanft.runtime log file. Any chance these give you any sort of idea? I updated the initial question – Tree55Topz Jul 11 '18 at 17:28
  • Sounds like the engine crashed (or was closed), and all other errors are a result of that action. If this is the same suite we talked about in [this question](https://stackoverflow.com/questions/51108038/leanft-running-tests-remotely-results-in-random-socketclient-exceptions) then it's due to the same hammering of the engine, one thread closes, another still uses it, etc. – Adelin Jul 12 '18 at 07:39
  • hahaha yes it is. – Tree55Topz Jul 12 '18 at 13:09
  • Possible duplicate of [LeanFT - Running tests remotely results in random SocketClient Exceptions](https://stackoverflow.com/questions/51108038/leanft-running-tests-remotely-results-in-random-socketclient-exceptions) – Adelin Jul 12 '18 at 13:28

0 Answers0