diff --git a/logstash-core/spec/api/lib/api/node_spec.rb b/logstash-core/spec/api/lib/api/node_spec.rb index d7c9efac4..357b3b5ba 100644 --- a/logstash-core/spec/api/lib/api/node_spec.rb +++ b/logstash-core/spec/api/lib/api/node_spec.rb @@ -64,9 +64,17 @@ describe LogStash::Api::Modules::Node do context "When asking for human output and threads count" do before(:all) do + # Make sure we have enough threads for this to work. + @threads = [] + 5.times { @threads << Thread.new { loop {} } } + do_request { get "/hot_threads?human=t&threads=2"} end + after(:all) do + @threads.each { |t| t.kill } rescue nil + end + let(:payload) { last_response.body } it "should return information for <= # requested threads" do