assertServerRunning

From the online help:

In [4]: HasyUtils.assertServerRunning?
Type:        function
String form: <function assertServerRunning at 0x7fe62f8d72a8>
File:        /usr/lib/python2.7/dist-packages/HasyUtils/TgUtils.py
Definition:  HasyUtils.assertServerRunning(serverName, dbHost)
Docstring:
use case: 
  to ensure that long measurements consisting of series of individualScans
  are not interrupted a Tango server crashes. 

what the function does:
  - get a device belonging to serverName
  - create a device proxy and evaluate the state
    + if OK, return True 
    + otherwise
      o wait until the server is no longer in the list of running servers
      o wait until the server appears in the list of stopped servers
      o start the server

implementation principle: 

  while True:
     try:
          individualScan()
     except:
          HasyUtils.assertServerRunning( "ServerInvolved/Instance", "haspp99:10000")

Another example can be found in the Spock manual, section Helpers.



Subsections

2019-11-13