Skip to content

Commit

Permalink
add additional testing for the stream socket addition
Browse files Browse the repository at this point in the history
  • Loading branch information
ddrthall committed Dec 4, 2024
1 parent e3b82a9 commit 1bdc678
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions tests/integration/dogstatsd/test_statsd_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ def test_stream_cleanup():

foo.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1) # different os's have different mins, e.g. this sets the buffer size to 2304 on certain linux variants

try:
with pytest.raises(socket.error):
foo.sendall(os.urandom(5000)) # pre-emptively clog the buffer
except BlockingIOError:
pass

statsd.increment("test", 1)

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/dogstatsd/test_statsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2124,13 +2124,13 @@ def test_fake_sockets(self):
"""
statsd = DogStatsd(disable_buffering=True)

class fake_sock:
class fakeSock:
def __init__(self, id):
self.id = id
def send(self, _):
pass
statsd.socket = fake_sock(5)
statsd.telemetry_socket = fake_sock(10)
statsd.socket = fakeSock(5)
statsd.telemetry_socket = fakeSock(10)

assert statsd.socket.id == 5
assert statsd.telemetry_socket.id == 10
Expand Down

0 comments on commit 1bdc678

Please sign in to comment.