From 815db5c7efa54cdef2e08af5f406fc59fef75b88 Mon Sep 17 00:00:00 2001 From: Azrenbeth <7782548+Azrenbeth@users.noreply.github.com> Date: Thu, 16 Sep 2021 17:32:38 +0100 Subject: [PATCH] Add longer wait before startup on integration tests. Get logging to work. --- .gitignore | 1 + matrix_is_test/launcher.py | 6 ++---- sydent/http/servlets/registerservlet.py | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8aa81acd..ef94a9f9 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ _trial_temp.lock /sydent.db /sydent.pid /matrix_is_test/sydent.stderr +/matrix_is_test/sydent.log diff --git a/matrix_is_test/launcher.py b/matrix_is_test/launcher.py index 8d60263e..5f9df0cc 100644 --- a/matrix_is_test/launcher.py +++ b/matrix_is_test/launcher.py @@ -33,6 +33,7 @@ terms.path = {terms_path} templates.path = {testsubject_path}/res brand.default = is-test +log.path = {testsubject_path}/sydent.log ip.whitelist = 127.0.0.1 @@ -89,18 +90,15 @@ def launch(self): } ) - stderr_fp = open(os.path.join(testsubject_path, "sydent.stderr"), "w") - pybin = os.getenv("SYDENT_PYTHON", "python") self.process = Popen( args=[pybin, "-m", "sydent.sydent"], cwd=self.tmpdir, env=newEnv, - stderr=stderr_fp, ) # XXX: wait for startup in a sensible way - time.sleep(2) + time.sleep(10) self._baseUrl = "http://localhost:%d" % (port,) diff --git a/sydent/http/servlets/registerservlet.py b/sydent/http/servlets/registerservlet.py index f87ef2cd..070edc2b 100644 --- a/sydent/http/servlets/registerservlet.py +++ b/sydent/http/servlets/registerservlet.py @@ -43,9 +43,11 @@ async def render_POST(self, request: Request) -> JsonDict: """ Register with the Identity Server """ + send_cors(request) args = get_args(request, ("matrix_server_name", "access_token")) + logger.info(args) matrix_server = args["matrix_server_name"].lower()