Changeset: 14e383b79e81 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=14e383b79e81
Modified Files:
        testing/process.py
Branch: Oct2020
Log Message:

Get actual listening port from server.
If server started with mapi_port=0, we should retrieve the actual port
from the .conn file and make it available to the client.


diffs (30 lines):

diff --git a/testing/process.py b/testing/process.py
--- a/testing/process.py
+++ b/testing/process.py
@@ -464,5 +464,26 @@ class server(Popen):
                 break
             if os.path.exists(started):
                 # server is ready
+                try:
+                    conn = open(os.path.join(dbpath, '.conn')).read()
+                except:
+                    if verbose:
+                        print('failed to open {}'.format(os.path.join(dbpath, 
'.conn')))
+                    pass
+                else:
+                    # retrieve mapi port if available
+                    for c in conn.splitlines():
+                        c = c.rstrip('/')
+                        c = c.rsplit(':', maxsplit=1)
+                        if len(c) == 2:
+                            try:
+                                port = int(c[1])
+                            except ValueError:
+                                pass
+                            else:
+                                if verbose:
+                                    print('mapi port: {}'.format(c[1]))
+                                self.dbport = c[1]
+                                break
                 break
             time.sleep(0.001)
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to