You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When all_services tries to use self.pgdir, a search is conducted from CWD to the root. If there is a playground subdirectory in any of the parents, it will be used. If no such directory exists in any of the parents, an exception is raised. The issue manifests when pgctl is invoked with a path to the playground.
With an invocation of self.all_services to PgctlApp.__change_state, DescribeDateExample.it_can_start_via_abspath_service will fail. This is because it runs with CWD set to arbitrary, and then passes a start command with a path pointing to the first date subdirectory.
.
├── arbitrary # CWD is here
├── date # (full path to this is passed to pgctl)
│ └── playground
│ └── date
│ ├── event
│ ├── log
│ ├── nosetsid
│ ├── run
│ └── supervise -> /nail/tmp/pytest-of-ngold/pytest-597/popen-gw2/it_can_start_via_abspath_servi0/home/.run/pgctl/nail/tmp/pytest-of-ngold/pytest-597/popen-gw2/it_can_start_via_abspath_servi0/date/playground/date/supervise
├── home
└── pytest-subprocesses.lock
______________________________________________ DescribeDateExample.it_can_start_via_abspath_service ______________________________________________
[gw2] linux2 -- Python 2.7.6 /nail/home/ngold/pg/pgctl/.tox/py27/bin/python2.7
self = <spec.examples.DescribeDateExample object at 0x1a6f350>
in_example_dir = local(u'/nail/tmp/pytest-of-ngold/pytest-597/popen-gw2/it_can_start_via_abspath_servi0/date')
scratch_dir = local(u'/nail/tmp/pytest-of-ngold/pytest-597/popen-gw2/it_can_start_via_abspat...old/pytest-597/popen-gw2/it_can_start_via_abspath_s
ervi0/date/playground/date')
tmpdir = local('/nail/tmp/pytest-of-ngold/pytest-597/popen-gw2/it_can_start_via_abspath_servi0')
def it_can_start_via_abspath_service(self, in_example_dir, scratch_dir, tmpdir):
with tmpdir.ensure_dir('arbitrary').as_cwd():
assert not scratch_dir.join('now.date').isfile()
date_abspath = str(in_example_dir.join('playground/date'))
> check_call(('pgctl', 'start', date_abspath))
/nail/home/ngold/pg/pgctl/tests/spec/examples.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nail/home/ngold/pg/pgctl/.tox/py27/lib/python2.7/site-packages/pgctl/subprocess.py:13: in wrapped
return func(cmd, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
popenargs = (('pgctl', 'start', '/nail/tmp/pytest-of-ngold/pytest-597/popen-gw2/it_can_start_via_abspath_servi0/date/playground/date'),)
kwargs = {'close_fds': False}, retcode = 1
cmd = ('pgctl', 'start', '/nail/tmp/pytest-of-ngold/pytest-597/popen-gw2/it_can_start_via_abspath_servi0/date/playground/date')
def check_call(*popenargs, **kwargs):
"""Run command with arguments. Wait for command to complete. If
the exit code was zero then return, otherwise raise
CalledProcessError. The CalledProcessError object will have the
return code in the returncode attribute.
The arguments are the same as for the Popen constructor. Example:
check_call(["ls", "-l"])
"""
retcode = call(*popenargs, **kwargs)
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
> raise CalledProcessError(retcode, cmd)
E CalledProcessError: Command '(u'pgctl', u'start', '/nail/tmp/pytest-of-ngold/pytest-597/popen-gw2/it_can_start_via_abspath_servi0/date
/playground/date')' returned non-zero exit status 1
/usr/lib/python2.7/subprocess.py:540: CalledProcessError
-------------------------------------------------------------- Captured stderr call --------------------------------------------------------------
[pgctl] Starting: date
[pgctl] Started: date
[pgctl] ERROR: could not find any directory named 'playground'
------------------------------------------------------------ Captured stderr teardown ------------------------------------------------------------
[pgctl] Stopping: date
[pgctl] Stopped: date
The text was updated successfully, but these errors were encountered:
When all_services tries to use self.pgdir, a search is conducted from CWD to the root. If there is a playground subdirectory in any of the parents, it will be used. If no such directory exists in any of the parents, an exception is raised. The issue manifests when pgctl is invoked with a path to the playground.
With an invocation of
self.all_services
toPgctlApp.__change_state
,DescribeDateExample.it_can_start_via_abspath_service
will fail. This is because it runs with CWD set toarbitrary
, and then passes a start command with a path pointing to the first date subdirectory.The text was updated successfully, but these errors were encountered: