API Documentation

class test_utils.process_runners.TCPProcessRunner(args, wait_for_address, wait_for_timeout=10, cwd=None, log_path='process.log')[source]

Represents a long running process which exposes a TCP interface and should be running during the test execution.

Parameters:
  • args (list) – Arguments passed to the subprocess.Popen.
  • wait_for_address (tuple (e.g. ('127.0.0.1', 8080))) – IP address and port to which we will connect to, to determine if the process is running.
  • wait_for_timeout (float) – How long to wait (in seconds) for the process to start before giving up.
  • cwd (str) – Working directory for the subprocess.Popen. (optional)
  • log_path (str) – Path to the log file where the process output will be saved. (optional)
setUp(*args, **kwargs)[source]

Start a managed process and wait for it to come online.

tearDown(*args, **kwargs)[source]

Terminate the running process.

Note: This function does not need to be called manually. Once you call setUp() function it automatically registers this function to run on the process exit.