Skip to content

Commit

Permalink
Clean up some test noise
Browse files Browse the repository at this point in the history
  • Loading branch information
catlee committed Mar 4, 2024
1 parent 5ba6853 commit 07743cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/environment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def test_client_from_env_uses_batched_udp_sink_in_production_environment
end

def test_client_from_env_uses_regular_udp_sink_when_flush_interval_is_0
StatsD::Instrument::Environment.any_instance.expects(:warn).with(
"STATSD_FLUSH_INTERVAL=0.0 is deprecated, please set STATSD_BUFFER_CAPACITY=0 instead.",
).once
env = StatsD::Instrument::Environment.new(
"STATSD_USE_NEW_CLIENT" => "1",
"STATSD_ENV" => "staging",
Expand Down
3 changes: 3 additions & 0 deletions test/udp_sink_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def test_socket_error_should_invalidate_socket
socket.expects(:close).in_sequence(seq)
socket.expects(:connect).with("localhost", 8125).in_sequence(seq)
socket.expects(:send).twice.returns(1).in_sequence(seq)
socket.expects(:close).in_sequence(seq)

udp_sink = build_sink("localhost", 8125)
udp_sink << "foo:1|c"
Expand All @@ -164,6 +165,8 @@ def test_socket_error_should_invalidate_socket
)
ensure
StatsD.logger = previous_logger
# Make sure our fake socket is closed so that it doesn't interfere with other tests
udp_sink&.send(:invalidate_socket)
end
end
end
Expand Down

0 comments on commit 07743cd

Please sign in to comment.