def stop()

in tsqa/environment.py [0:0]


    def stop(self):
        log.debug("Stopping traffic cop: %s", self.cop)
        if self.running():
            self.cop.kill()
            # wait for a max of 2s
            stoptime = time.time() + 2
            while time.time() < stoptime:
                # if we got a returncode, we exited
                if self.cop.poll() is not None:
                    return
                time.sleep(0.1)
            log.error('Unable to stop traffic_cop: {0}'.format(self.cop))
            self.cop.terminate()  # TODO: remove?? or wait...