# Path: pgctl/subprocess.py
# PIPE = subprocess.PIPE
# 
# Path: pgctl/subprocess.py
# def set_defaults(func, **defaults):
#     def wrapped(cmd, **kwargs):
# PIPE = subprocess.PIPE
# STDOUT = subprocess.STDOUT


from time import sleep
from testing import norm
from testing.service_context import set_slow_shutdown_sleeptime
from testing.subprocess import assert_command
from testing.subprocess import show_both
from pgctl.subprocess import PIPE
from pgctl.subprocess import Popen
import pytest




@pytest.fixture(autouse=True)
def sleep_short_background_long_foreground():
    with set_slow_shutdown_sleeptime(0.75, 2.25):
        yield


@pytest.mark.parametrize('service_name', ['slow-shutdown'])
@pytest.mark.usefixtures('in_example_dir')
def it_is_disallowed():
    assert_command(
        ('pgctl', 'start'),
        '',
        '''\
[pgctl] Starting: sweet
[pgctl] Started: sweet
''',
        0,
    )


# Path: pgctl/subprocess.py
# PIPE = subprocess.PIPE
# 
# Path: pgctl/subprocess.py
# def set_defaults(func, **defaults):
#     def wrapped(cmd, **kwargs):
# PIPE = subprocess.PIPE
# STDOUT = subprocess.STDOUT


# Path: tests/spec/parallel.py
from time import sleep
from testing import norm
from testing.service_context import set_slow_shutdown_sleeptime
from testing.subprocess import assert_command
from testing.subprocess import show_both
from pgctl.subprocess import PIPE
from pgctl.subprocess import Popen
import pytest





@pytest.fixture(autouse=True)
def sleep_short_background_long_foreground():
    with set_slow_shutdown_sleeptime(0.75, 2.25):
        yield


@pytest.mark.parametrize('service_name', ['slow-shutdown'])
@pytest.mark.usefixtures('in_example_dir')
def it_is_disallowed():
    assert_command(
        ('pgctl', 'start'),
        '',
        '''\
[pgctl] Starting: sweet
[pgctl] Started: sweet
''',
        0,
    )


    first = Popen(('pgctl', 'restart', '--no-force'), stdout=PIPE, stderr=PIPE)