コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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
コード例 #4
0
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
コード例 #5
0
 def assert_living_pids():
     assert len(living_pids(pid_tree(os.getpid()))) == 6
コード例 #6
0
 def assert_living_pids():
     assert len(living_pids(pid_tree(os.getpid()))) == 6