diff --git a/lib/midi-smtp-server.rb b/lib/midi-smtp-server.rb index b12dc3d..1bbbacd 100644 --- a/lib/midi-smtp-server.rb +++ b/lib/midi-smtp-server.rb @@ -143,15 +143,21 @@ def workers? # before joining the server threads, check and wait optionally a few seconds # to let the service(s) come up def join(sleep_seconds_before_join: 1) + # set process name + $0 = "[MidiSmtp] #{ARGV.join(' ')} (main)" # check already existing TCPServers return if @tcp_servers.empty? # check number of processes to pre-fork if pre_fork? # create a number of pre-fork processes and attach and join threads within workers + idx = 0 @pre_fork.times do # append worker pid to list of workers @workers << fork do + # set forked process name + $0 = "[MidiSmtp] #{ARGV.join(' ')} (worker #{idx})" + idx += 1 # set state for a forked process @is_forked = true # just attach and join the threads to forked worker process diff --git a/test/integration/io_waitreadable_test.rb b/test/integration/io_waitreadable_test.rb index d9d481e..bde67bf 100644 --- a/test/integration/io_waitreadable_test.rb +++ b/test/integration/io_waitreadable_test.rb @@ -50,7 +50,7 @@ def io_waitreadable_sleep def test_slow_io_waitreadable_sleep # This test hits IO::WaitReadable exception multiple times # For that, this test must run longer than 1 second - assert measure_io_waitreadable_sleep > 1 + assert_operator measure_io_waitreadable_sleep, :>, 1 end end @@ -67,7 +67,7 @@ def io_waitreadable_sleep def test_fast_io_waitreadable_sleep # This test hits IO::WaitReadable exception multiple times # For that, this test must run longer than 1 second - assert measure_io_waitreadable_sleep < 1 + assert_operator measure_io_waitreadable_sleep, :<, 1 end end