def METHOD_NAME(monkeypatch):
    """Setup a mock'd up environment for socket.create_connection to drive
    ConnectionRefusedError behaviors.
    The `wait_for_uri()` method invokes `socket.create_connection()`,
    `time.time()` to get the current timestamp, and `time.sleep()` to wait one
    second before re-trying to create a connection.
    An example sequence of calls made by `wait_for_uri()`:
        1. time()
        2. create_connection() - raises ConnectionRefusedError()
        3. time()
        4. sleep()
        5. create_connection() - raises ConnectionRefusedError()
        6. time()
        7. sleep()
        8. create_connection() - succeeds
    Each mock'd call to `time()` returns the current time, starting at 0, and
    increments the "clock" by one.
    Each mock'd call to `sleep()` simply records that it was called, and returns
    immediately.
    Each mock'd call to `create_connection()` records it was called, along with
    the current clock value, raises ConnectionRefusedError() while the clock is
    strictly less than 3, and returns successfully (really yields to make the
    contextmanager behavior work) when the clock is 3 or greater.
    """
    clock = [0]
    called = []
    @contextmanager
    def conn_ref(*args, **kwargs):
        called.append(f"conn_ref [{clock[0]}]")
        if clock[0] < 3:
            raise ConnectionRefusedError()
        yield None
    def sleep(*args, **kwargs):
        called.append("sleep")
    def time() -> int:
        curr_time = clock[0]
        called.append(f"time [{curr_time}]")
        clock[0] += 1
        return curr_time
    monkeypatch.setattr(socket, "create_connection", conn_ref)
    monkeypatch.setattr(pbench.common, "sleep", sleep)
    monkeypatch.setattr(pbench.common, "time", time)
    return called