prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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_
  
  </issue>
  <code>
  [start of src/epplibwrapper/utility/pool.py]
  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 of src/epplibwrapper/utility/pool.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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)
  
verification_info: {"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"}]}