Browse files

Simplify live tests by removing Thread

  • Loading branch information...
1 parent 602e071 commit 6ac9442f9c55b836421f1869ff892b34009656c2 @wvanbergen wvanbergen committed Dec 27, 2013
Showing with 3 additions and 11 deletions.
  1. +3 −11 test/statsd_test.rb
View
14 test/statsd_test.rb
@@ -197,18 +197,10 @@ def test_live_local_udp_socket
StatsD.stubs(:mode).returns(:production)
StatsD.server = "localhost:31798"
- received_command = nil
- t = Thread.new do
- server = UDPSocket.new
- server.bind('localhost', 31798)
-
- result = server.recvfrom(1000)
- received_command = result.first
- end
+ server = UDPSocket.new
+ server.bind('localhost', 31798)
StatsD.increment('counter')
- t.join
-
- assert_equal "counter:1|c", received_command
+ assert_equal "counter:1|c", server.recvfrom(100).first
end
end

0 comments on commit 6ac9442

Please sign in to comment.