We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Clean up test noise (that includes EPP and migration scripts)
### Issue description

Right now if you run the test suite locally or see the output from github, there is a lot of added prints and logs that make it hard to troubleshoot where your particular error is coming from. This ticket is clean up test noise in general including EPP and migration scripts. 



### Acceptance criteria

- [ ] unnecessary prints/logs on tests are removed

### Additional context

_No response_

### Links to other issues

_No response_

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/epplibwrapper/utility/pool.py`
Content:
```
1 import logging
2 from typing import List
3 import gevent
4 from geventconnpool import ConnectionPool
5 from epplibwrapper.socket import Socket
6 from epplibwrapper.utility.pool_error import PoolError, PoolErrorCodes
7 
8 try:
9     from epplib.commands import Hello
10     from epplib.exceptions import TransportError
11 except ImportError:
12     pass
13 
14 from gevent.lock import BoundedSemaphore
15 from collections import deque
16 
17 logger = logging.getLogger(__name__)
18 
19 
20 class EPPConnectionPool(ConnectionPool):
21     """A connection pool for EPPLib.
22 
23     Args:
24         client (Client): The client
25         login (commands.Login): Login creds
26         options (dict): Options for the ConnectionPool
27         base class
28     """
29 
30     def __init__(self, client, login, options: dict):
31         # For storing shared credentials
32         self._client = client
33         self._login = login
34 
35         # Keep track of each greenlet
36         self.greenlets: List[gevent.Greenlet] = []
37 
38         # Define optional pool settings.
39         # Kept in a dict so that the parent class,
40         # client.py, can maintain seperation/expandability
41         self.size = 1
42         if "size" in options:
43             self.size = options["size"]
44 
45         self.exc_classes = tuple((TransportError,))
46         if "exc_classes" in options:
47             self.exc_classes = options["exc_classes"]
48 
49         self.keepalive = None
50         if "keepalive" in options:
51             self.keepalive = options["keepalive"]
52 
53         # Determines the period in which new
54         # gevent threads are spun up.
55         # This time period is in seconds. So for instance, .1 would be .1 seconds.
56         self.spawn_frequency = 0.1
57         if "spawn_frequency" in options:
58             self.spawn_frequency = options["spawn_frequency"]
59 
60         self.conn: deque = deque()
61         self.lock = BoundedSemaphore(self.size)
62 
63         self.populate_all_connections()
64 
65     def _new_connection(self):
66         socket = self._create_socket(self._client, self._login)
67         try:
68             connection = socket.connect()
69             return connection
70         except Exception as err:
71             message = f"Failed to execute due to a registry error: {err}"
72             logger.error(message, exc_info=True)
73             # We want to raise a pool error rather than a LoginError here
74             # because if this occurs internally, we should handle this
75             # differently than we otherwise would for LoginError.
76             raise PoolError(code=PoolErrorCodes.NEW_CONNECTION_FAILED) from err
77 
78     def _keepalive(self, c):
79         """Sends a command to the server to keep the connection alive."""
80         try:
81             # Sends a ping to the registry via EPPLib
82             c.send(Hello())
83         except Exception as err:
84             message = "Failed to keep the connection alive."
85             logger.error(message, exc_info=True)
86             raise PoolError(code=PoolErrorCodes.KEEP_ALIVE_FAILED) from err
87 
88     def _create_socket(self, client, login) -> Socket:
89         """Creates and returns a socket instance"""
90         socket = Socket(client, login)
91         return socket
92 
93     def get_connections(self):
94         """Returns the connection queue"""
95         return self.conn
96 
97     def kill_all_connections(self):
98         """Kills all active connections in the pool."""
99         try:
100             if len(self.conn) > 0 or len(self.greenlets) > 0:
101                 logger.info("Attempting to kill connections")
102                 gevent.killall(self.greenlets)
103 
104                 self.greenlets.clear()
105                 for connection in self.conn:
106                     connection.disconnect()
107                 self.conn.clear()
108 
109                 # Clear the semaphore
110                 self.lock = BoundedSemaphore(self.size)
111                 logger.info("Finished killing connections")
112             else:
113                 logger.info("No connections to kill.")
114         except Exception as err:
115             logger.error("Could not kill all connections.")
116             raise PoolError(code=PoolErrorCodes.KILL_ALL_FAILED) from err
117 
118     def populate_all_connections(self):
119         """Generates the connection pool.
120         If any connections exist, kill them first.
121         Based off of the __init__ definition for geventconnpool.
122         """
123         if len(self.conn) > 0 or len(self.greenlets) > 0:
124             self.kill_all_connections()
125 
126         # Setup the lock
127         for i in range(self.size):
128             self.lock.acquire()
129 
130         # Open multiple connections
131         for i in range(self.size):
132             self.greenlets.append(gevent.spawn_later(self.spawn_frequency * i, self._addOne))
133 
134         # Open a "keepalive" thread if we want to ping open connections
135         if self.keepalive:
136             self.greenlets.append(gevent.spawn(self._keepalive_periodic))
137
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/epplibwrapper/utility/pool.py b/src/epplibwrapper/utility/pool.py
--- a/src/epplibwrapper/utility/pool.py
+++ b/src/epplibwrapper/utility/pool.py
@@ -85,6 +85,21 @@
             logger.error(message, exc_info=True)
             raise PoolError(code=PoolErrorCodes.KEEP_ALIVE_FAILED) from err
 
+    def _keepalive_periodic(self):
+        """Overriding _keepalive_periodic from geventconnpool so that PoolErrors
+        are properly handled, as opposed to printing to stdout"""
+        delay = float(self.keepalive) / self.size
+        while 1:
+            try:
+                with self.get() as c:
+                    self._keepalive(c)
+            except PoolError as err:
+                logger.error(err.message, exc_info=True)
+            except self.exc_classes:
+                # Nothing to do, the pool will generate a new connection later
+                pass
+            gevent.sleep(delay)
+
     def _create_socket(self, client, login) -> Socket:
         """Creates and returns a socket instance"""
         socket = Socket(client, login)

{"golden_diff": "diff --git a/src/epplibwrapper/utility/pool.py b/src/epplibwrapper/utility/pool.py\n--- a/src/epplibwrapper/utility/pool.py\n+++ b/src/epplibwrapper/utility/pool.py\n@@ -85,6 +85,21 @@\n             logger.error(message, exc_info=True)\n             raise PoolError(code=PoolErrorCodes.KEEP_ALIVE_FAILED) from err\n \n+    def _keepalive_periodic(self):\n+        \"\"\"Overriding _keepalive_periodic from geventconnpool so that PoolErrors\n+        are properly handled, as opposed to printing to stdout\"\"\"\n+        delay = float(self.keepalive) / self.size\n+        while 1:\n+            try:\n+                with self.get() as c:\n+                    self._keepalive(c)\n+            except PoolError as err:\n+                logger.error(err.message, exc_info=True)\n+            except self.exc_classes:\n+                # Nothing to do, the pool will generate a new connection later\n+                pass\n+            gevent.sleep(delay)\n+\n     def _create_socket(self, client, login) -> Socket:\n         \"\"\"Creates and returns a socket instance\"\"\"\n         socket = Socket(client, login)\n", "issue": "Clean up test noise (that includes EPP and migration scripts)\n### Issue description\r\n\r\nRight now if you run the test suite locally or see the output from github, there is a lot of added prints and logs that make it hard to troubleshoot where your particular error is coming from. This ticket is clean up test noise in general including EPP and migration scripts. \r\n\r\n\r\n\r\n### Acceptance criteria\r\n\r\n- [ ] unnecessary prints/logs on tests are removed\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Links to other issues\r\n\r\n_No response_\n", "before_files": [{"content": "import logging\nfrom typing import List\nimport gevent\nfrom geventconnpool import ConnectionPool\nfrom epplibwrapper.socket import Socket\nfrom epplibwrapper.utility.pool_error import PoolError, PoolErrorCodes\n\ntry:\n    from epplib.commands import Hello\n    from epplib.exceptions import TransportError\nexcept ImportError:\n    pass\n\nfrom gevent.lock import BoundedSemaphore\nfrom collections import deque\n\nlogger = logging.getLogger(__name__)\n\n\nclass EPPConnectionPool(ConnectionPool):\n    \"\"\"A connection pool for EPPLib.\n\n    Args:\n        client (Client): The client\n        login (commands.Login): Login creds\n        options (dict): Options for the ConnectionPool\n        base class\n    \"\"\"\n\n    def __init__(self, client, login, options: dict):\n        # For storing shared credentials\n        self._client = client\n        self._login = login\n\n        # Keep track of each greenlet\n        self.greenlets: List[gevent.Greenlet] = []\n\n        # Define optional pool settings.\n        # Kept in a dict so that the parent class,\n        # client.py, can maintain seperation/expandability\n        self.size = 1\n        if \"size\" in options:\n            self.size = options[\"size\"]\n\n        self.exc_classes = tuple((TransportError,))\n        if \"exc_classes\" in options:\n            self.exc_classes = options[\"exc_classes\"]\n\n        self.keepalive = None\n        if \"keepalive\" in options:\n            self.keepalive = options[\"keepalive\"]\n\n        # Determines the period in which new\n        # gevent threads are spun up.\n        # This time period is in seconds. So for instance, .1 would be .1 seconds.\n        self.spawn_frequency = 0.1\n        if \"spawn_frequency\" in options:\n            self.spawn_frequency = options[\"spawn_frequency\"]\n\n        self.conn: deque = deque()\n        self.lock = BoundedSemaphore(self.size)\n\n        self.populate_all_connections()\n\n    def _new_connection(self):\n        socket = self._create_socket(self._client, self._login)\n        try:\n            connection = socket.connect()\n            return connection\n        except Exception as err:\n            message = f\"Failed to execute due to a registry error: {err}\"\n            logger.error(message, exc_info=True)\n            # We want to raise a pool error rather than a LoginError here\n            # because if this occurs internally, we should handle this\n            # differently than we otherwise would for LoginError.\n            raise PoolError(code=PoolErrorCodes.NEW_CONNECTION_FAILED) from err\n\n    def _keepalive(self, c):\n        \"\"\"Sends a command to the server to keep the connection alive.\"\"\"\n        try:\n            # Sends a ping to the registry via EPPLib\n            c.send(Hello())\n        except Exception as err:\n            message = \"Failed to keep the connection alive.\"\n            logger.error(message, exc_info=True)\n            raise PoolError(code=PoolErrorCodes.KEEP_ALIVE_FAILED) from err\n\n    def _create_socket(self, client, login) -> Socket:\n        \"\"\"Creates and returns a socket instance\"\"\"\n        socket = Socket(client, login)\n        return socket\n\n    def get_connections(self):\n        \"\"\"Returns the connection queue\"\"\"\n        return self.conn\n\n    def kill_all_connections(self):\n        \"\"\"Kills all active connections in the pool.\"\"\"\n        try:\n            if len(self.conn) > 0 or len(self.greenlets) > 0:\n                logger.info(\"Attempting to kill connections\")\n                gevent.killall(self.greenlets)\n\n                self.greenlets.clear()\n                for connection in self.conn:\n                    connection.disconnect()\n                self.conn.clear()\n\n                # Clear the semaphore\n                self.lock = BoundedSemaphore(self.size)\n                logger.info(\"Finished killing connections\")\n            else:\n                logger.info(\"No connections to kill.\")\n        except Exception as err:\n            logger.error(\"Could not kill all connections.\")\n            raise PoolError(code=PoolErrorCodes.KILL_ALL_FAILED) from err\n\n    def populate_all_connections(self):\n        \"\"\"Generates the connection pool.\n        If any connections exist, kill them first.\n        Based off of the __init__ definition for geventconnpool.\n        \"\"\"\n        if len(self.conn) > 0 or len(self.greenlets) > 0:\n            self.kill_all_connections()\n\n        # Setup the lock\n        for i in range(self.size):\n            self.lock.acquire()\n\n        # Open multiple connections\n        for i in range(self.size):\n            self.greenlets.append(gevent.spawn_later(self.spawn_frequency * i, self._addOne))\n\n        # Open a \"keepalive\" thread if we want to ping open connections\n        if self.keepalive:\n            self.greenlets.append(gevent.spawn(self._keepalive_periodic))\n", "path": "src/epplibwrapper/utility/pool.py"}], "after_files": [{"content": "import logging\nfrom typing import List\nimport gevent\nfrom geventconnpool import ConnectionPool\nfrom epplibwrapper.socket import Socket\nfrom epplibwrapper.utility.pool_error import PoolError, PoolErrorCodes\n\ntry:\n    from epplib.commands import Hello\n    from epplib.exceptions import TransportError\nexcept ImportError:\n    pass\n\nfrom gevent.lock import BoundedSemaphore\nfrom collections import deque\n\nlogger = logging.getLogger(__name__)\n\n\nclass EPPConnectionPool(ConnectionPool):\n    \"\"\"A connection pool for EPPLib.\n\n    Args:\n        client (Client): The client\n        login (commands.Login): Login creds\n        options (dict): Options for the ConnectionPool\n        base class\n    \"\"\"\n\n    def __init__(self, client, login, options: dict):\n        # For storing shared credentials\n        self._client = client\n        self._login = login\n\n        # Keep track of each greenlet\n        self.greenlets: List[gevent.Greenlet] = []\n\n        # Define optional pool settings.\n        # Kept in a dict so that the parent class,\n        # client.py, can maintain seperation/expandability\n        self.size = 1\n        if \"size\" in options:\n            self.size = options[\"size\"]\n\n        self.exc_classes = tuple((TransportError,))\n        if \"exc_classes\" in options:\n            self.exc_classes = options[\"exc_classes\"]\n\n        self.keepalive = None\n        if \"keepalive\" in options:\n            self.keepalive = options[\"keepalive\"]\n\n        # Determines the period in which new\n        # gevent threads are spun up.\n        # This time period is in seconds. So for instance, .1 would be .1 seconds.\n        self.spawn_frequency = 0.1\n        if \"spawn_frequency\" in options:\n            self.spawn_frequency = options[\"spawn_frequency\"]\n\n        self.conn: deque = deque()\n        self.lock = BoundedSemaphore(self.size)\n\n        self.populate_all_connections()\n\n    def _new_connection(self):\n        socket = self._create_socket(self._client, self._login)\n        try:\n            connection = socket.connect()\n            return connection\n        except Exception as err:\n            message = f\"Failed to execute due to a registry error: {err}\"\n            logger.error(message, exc_info=True)\n            # We want to raise a pool error rather than a LoginError here\n            # because if this occurs internally, we should handle this\n            # differently than we otherwise would for LoginError.\n            raise PoolError(code=PoolErrorCodes.NEW_CONNECTION_FAILED) from err\n\n    def _keepalive(self, c):\n        \"\"\"Sends a command to the server to keep the connection alive.\"\"\"\n        try:\n            # Sends a ping to the registry via EPPLib\n            c.send(Hello())\n        except Exception as err:\n            message = \"Failed to keep the connection alive.\"\n            logger.error(message, exc_info=True)\n            raise PoolError(code=PoolErrorCodes.KEEP_ALIVE_FAILED) from err\n\n    def _keepalive_periodic(self):\n        \"\"\"Overriding _keepalive_periodic from geventconnpool so that PoolErrors\n        are properly handled, as opposed to printing to stdout\"\"\"\n        delay = float(self.keepalive) / self.size\n        while 1:\n            try:\n                with self.get() as c:\n                    self._keepalive(c)\n            except PoolError as err:\n                logger.error(err.message, exc_info=True)\n            except self.exc_classes:\n                # Nothing to do, the pool will generate a new connection later\n                pass\n            gevent.sleep(delay)\n\n    def _create_socket(self, client, login) -> Socket:\n        \"\"\"Creates and returns a socket instance\"\"\"\n        socket = Socket(client, login)\n        return socket\n\n    def get_connections(self):\n        \"\"\"Returns the connection queue\"\"\"\n        return self.conn\n\n    def kill_all_connections(self):\n        \"\"\"Kills all active connections in the pool.\"\"\"\n        try:\n            if len(self.conn) > 0 or len(self.greenlets) > 0:\n                logger.info(\"Attempting to kill connections\")\n                gevent.killall(self.greenlets)\n\n                self.greenlets.clear()\n                for connection in self.conn:\n                    connection.disconnect()\n                self.conn.clear()\n\n                # Clear the semaphore\n                self.lock = BoundedSemaphore(self.size)\n                logger.info(\"Finished killing connections\")\n            else:\n                logger.info(\"No connections to kill.\")\n        except Exception as err:\n            logger.error(\"Could not kill all connections.\")\n            raise PoolError(code=PoolErrorCodes.KILL_ALL_FAILED) from err\n\n    def populate_all_connections(self):\n        \"\"\"Generates the connection pool.\n        If any connections exist, kill them first.\n        Based off of the __init__ definition for geventconnpool.\n        \"\"\"\n        if len(self.conn) > 0 or len(self.greenlets) > 0:\n            self.kill_all_connections()\n\n        # Setup the lock\n        for i in range(self.size):\n            self.lock.acquire()\n\n        # Open multiple connections\n        for i in range(self.size):\n            self.greenlets.append(gevent.spawn_later(self.spawn_frequency * i, self._addOne))\n\n        # Open a \"keepalive\" thread if we want to ping open connections\n        if self.keepalive:\n            self.greenlets.append(gevent.spawn(self._keepalive_periodic))\n", "path": "src/epplibwrapper/utility/pool.py"}]}