leanft

LeanFT - Running tests remotely results in random SocketClient Exceptions


We have a large automated test suites that seperates test out into 4 groups. These 4 groups are ran on different remote machines. Occasionaly, tests will start to fail and we get the following error message

HP.LFT.Communication.SocketClient.CommunicationException : Send: client is not connected

This just happens out of no where and it causes all the tests afterwards to fail. Is there anyway to fix this issue?


Solution

  • client is not connected issues are often thrown when multiple tasks are operating the exact same app and one of the tasks does a LeanFT disconnect (call to SDK.cleanup()) while another task still tries to query the AUT.

    These issues do not have a one-off solution. They are generally fixed case by case and needs to be debugged in the context of the very execution.

    In that direction, you can increase the already existent debug log levels by following the steps mentioned in this thread:

    1. Create the following directory: %localappdata%\Hewlett-Packard\LeanFT\LogConfigurations
    2. In that directory create a file named leanft.runtime.log.config.json
    3. Enter the following text in the file and save it:

      {
        "levels": {
        "[all]": "trace"
      },
        "appenders": [{
          "type": "file",
          "absolute": true,
          "filename": "c:/hpe.leanft.runtime.log",
          "maxLogSize": 5242880,
          "backups": 5
        }]
      }
      
    4. restart the engine

    5. reproduce the issue

    And

    1. Check the logs to see which step closed the connection and fix the concurrency issue.