Sha256: 2d25ee76518b5f2c24a10eccba678fe8f4482b8252bb785c561dd305fb8bded3

Contents?: true

Size: 643 Bytes

Versions: 22

Compression:

Stored size: 643 Bytes

Contents

# encoding: utf-8
require "childprocess"
module ClientProcessHelpers
  def start_client(timeout = 1)
    @client_out = Stud::Temporary.file
    @client_out.sync

    @process = ChildProcess.build(*cmd)
    @process.duplex = true
    @process.io.stdout = @process.io.stderr = @client_out
    ChildProcess.posix_spawn = true
    @process.start

    sleep(0.1)
    @client_out.rewind

    # can be used to helper debugging when a test fails
    @execution_output = @client_out.read
  end

  def stop_client
    begin
      @process.poll_for_exit(5)
    rescue ChildProcess::TimeoutError
      Process.kill("KILL", @process.pid)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
logstash-input-beats-3.1.18-java spec/support/client_process_helpers.rb
logstash-input-beats-4.0.2-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.17-java spec/support/client_process_helpers.rb
logstash-input-beats-4.0.1-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.15-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.14-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.12-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.11-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.10-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.9-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.8-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.7-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.6-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.5-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.4-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.3-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.2-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.1-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.0-java spec/support/client_process_helpers.rb
logstash-input-beats-3.1.0.beta4-java spec/support/client_process_helpers.rb