diff --git a/spec/inputs/tcp_spec.rb b/spec/inputs/tcp_spec.rb index da66a92..84441e6 100644 --- a/spec/inputs/tcp_spec.rb +++ b/spec/inputs/tcp_spec.rb @@ -72,6 +72,7 @@ def get_port end insist { events.length } == event_count + events = events.sort_by {|e| e.get("message")} # the ordering of events in the queue is highly timing-dependent event_count.times do |i| event = events[i] insist { event.get("message") } == "#{i} ☹" @@ -106,6 +107,7 @@ def get_port end insist { events.length } == event_count + events = events.sort_by {|e| e.get("message")} # the ordering of events in the queue is highly timing-dependent event_count.times do |i| insist { events[i].get("message") } == "#{i} ☹" insist { events[i].get("host") } == "1.2.3.4" @@ -231,6 +233,7 @@ def get_port (1..event_count).map{queue.pop} end + events = events.sort_by {|e| e.get("idx")} # the ordering of events in the queue is highly timing-dependent events.each_with_index do |event, idx| insist { event.get("hello") } == data["hello"] insist { event.get("foo").to_a } == data["foo"] # to_a to cast Java ArrayList produced by JrJackson