From fd3623ff139c9669fc9344fe5888e59ff0eebabe Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Sat, 22 Apr 2023 08:02:20 -0700 Subject: [PATCH] mm --- .circleci/run_tests.sh | 3 +++ src/server.rs | 2 ++ tests/python/async_test.py | 11 +++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.circleci/run_tests.sh b/.circleci/run_tests.sh index e44f80f..ccbb71a 100644 --- a/.circleci/run_tests.sh +++ b/.circleci/run_tests.sh @@ -107,6 +107,9 @@ cd ../.. # pip3 install -r tests/python/requirements.txt python3 tests/python/tests.py || exit 1 + +start_pgcat "info" + python3 tests/python/async_test.py start_pgcat "info" diff --git a/src/server.rs b/src/server.rs index 8c1ab70..be731fb 100644 --- a/src/server.rs +++ b/src/server.rs @@ -569,6 +569,8 @@ impl Server { let code = message.get_u8() as char; let _len = message.get_i32(); + trace!("Message: {}", code); + match code { // ReadyForQuery 'Z' => { diff --git a/tests/python/async_test.py b/tests/python/async_test.py index 27038ff..34a65e0 100644 --- a/tests/python/async_test.py +++ b/tests/python/async_test.py @@ -2,15 +2,18 @@ import psycopg2 import asyncio import asyncpg +PGCAT_HOST = "127.0.0.1" +PGCAT_PORT = "6432" + def regular_main(): # Connect to the PostgreSQL database conn = psycopg2.connect( - host="localhost", + host=PGCAT_HOST, database="sharded_db", user="sharding_user", password="sharding_user", - port=6432, + port=PGCAT_PORT, ) # Open a cursor to perform database operations @@ -34,11 +37,11 @@ def regular_main(): async def main(): # Connect to the PostgreSQL database conn = await asyncpg.connect( - host="localhost", + host=PGCAT_HOST, database="sharded_db", user="sharding_user", password="sharding_user", - port=6432, + port=PGCAT_PORT, ) # Execute a SQL query