def spawn_and_kill_pipeline(): proc = Popen(('dumb-init', 'sh', '-c', "yes 'oh, hi' | tail & yes error | tail >&2")) def assert_living_pids(): assert len(living_pids(pid_tree(os.getpid()))) == 6 sleep_until(assert_living_pids) pids = pid_tree(os.getpid()) proc.send_signal(signal.SIGTERM) proc.wait() return pids
def spawn_and_kill_pipeline(): proc = Popen(('dumb-init', 'sh', '-c', "yes 'oh, hi' | tail & yes error | tail >&2")) time.sleep(0.1) pids = pid_tree(os.getpid()) assert len(living_pids(pids)) == 6 proc.send_signal(signal.SIGTERM) proc.wait() time.sleep(0.1) return pids
def spawn_and_kill_pipeline(): proc = Popen(( 'dumb-init', 'sh', '-c', "yes 'oh, hi' | tail & yes error | tail >&2" )) time.sleep(0.1) pids = pid_tree(os.getpid()) assert len(living_pids(pids)) == 6 proc.send_signal(signal.SIGTERM) proc.wait() time.sleep(0.1) return pids
def spawn_and_kill_pipeline(): proc = Popen(( 'dumb-init', 'sh', '-c', "yes 'oh, hi' | tail & yes error | tail >&2" )) def assert_living_pids(): assert len(living_pids(pid_tree(os.getpid()))) == 6 sleep_until(assert_living_pids) pids = pid_tree(os.getpid()) proc.send_signal(signal.SIGTERM) proc.wait() return pids
def assert_living_pids(): assert len(living_pids(pid_tree(os.getpid()))) == 6