'Called by the test to wait until the flow heartbeats.
Args:
last_heartbeat: If True, the flow won\'t heartbeat anymore. Consequently,
the test won\'t be supposed to call LetFlowHeartBeat and
WaitForFlowHeartBeat methods.
Raises:
RuntimeError: if heartbeat is not enabled. Heartbeat can be enabled via
Reset() method.'

@classmethod
def WaitForFlowHeartBeat(cls, last_heartbeat=False):

    if (not cls.HEARTBEAT):
        raise RuntimeError('WaitForFlowHeartBeat    called,    but    heartbeat    not    enabled.')
    if last_heartbeat:
        cls.HEARTBEAT = False
    cls.WAIT_FOR_FLOW_HEARTBEAT_SEMAPHORE.acquire()
