except:
pass
+ # Before trying to start up our own server, call stop() to avoid
+ # "Phusion Passenger Standalone is already running on PID 12345".
+ # We want to kill it if it's our own _or_ it's some stale
+ # left-over server. But if it's been deliberately provided to us
+ # by a parent process, we don't want to force-kill it. That'll
+ # just wreck things for the next test suite that tries to use it.
+ stop(force=('ARVADOS_TEST_API_HOST' not in os.environ))
+
restore_cwd = os.getcwd()
api_src_dir = os.path.join(SERVICES_SRC_DIR, 'api')
os.chdir(api_src_dir)