From 35d557c635a5a144873f62c6a781edc1d6ca87ea Mon Sep 17 00:00:00 2001 From: Iuri G <289754+iuri-gg@users.noreply.github.com> Date: Sun, 19 Nov 2023 21:29:43 -0600 Subject: [PATCH 1/5] * Add support for setting process name --- lib/midi-smtp-server.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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 From d34368737dcc8af4147132b758d0d02d8f18732f Mon Sep 17 00:00:00 2001 From: Iuri G <289754+iuri-gg@users.noreply.github.com> Date: Sun, 19 Nov 2023 21:34:52 -0600 Subject: [PATCH 2/5] * Fix linting --- test/integration/io_waitreadable_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 2a47ad0f87b132965015cc047d3b5c0460c173c6 Mon Sep 17 00:00:00 2001 From: Iuri G <289754+iuri-gg@users.noreply.github.com> Date: Sun, 19 Nov 2023 21:36:27 -0600 Subject: [PATCH 3/5] * speed up gem installation in ci --- .github/workflows/push-and-pr-testing-ruby-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-and-pr-testing-ruby-ci.yml b/.github/workflows/push-and-pr-testing-ruby-ci.yml index 512eef3..dd9788c 100644 --- a/.github/workflows/push-and-pr-testing-ruby-ci.yml +++ b/.github/workflows/push-and-pr-testing-ruby-ci.yml @@ -40,7 +40,7 @@ jobs: # handle IPv6 issues with bundler echo ":ipv4_fallback_enabled: true" > .gemrc export GEMRC=".gemrc" - bundle install + bundle install -j8 - name: Run rubocop run: | bundle exec rake rubocop From 9771f9d911e4e6228d1215ee98903e8781295605 Mon Sep 17 00:00:00 2001 From: Iuri G <289754+iuri-gg@users.noreply.github.com> Date: Sun, 19 Nov 2023 21:38:42 -0600 Subject: [PATCH 4/5] * speed up gem installation in ci --- .github/workflows/push-and-pr-testing-ruby-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-and-pr-testing-ruby-ci.yml b/.github/workflows/push-and-pr-testing-ruby-ci.yml index dd9788c..15b2776 100644 --- a/.github/workflows/push-and-pr-testing-ruby-ci.yml +++ b/.github/workflows/push-and-pr-testing-ruby-ci.yml @@ -40,7 +40,7 @@ jobs: # handle IPv6 issues with bundler echo ":ipv4_fallback_enabled: true" > .gemrc export GEMRC=".gemrc" - bundle install -j8 + bundle install -j16 - name: Run rubocop run: | bundle exec rake rubocop From 3d5e67f8c451c3c341ce607cc8d1c353e5bc5ab6 Mon Sep 17 00:00:00 2001 From: Iuri G <289754+iuri-gg@users.noreply.github.com> Date: Sun, 19 Nov 2023 21:40:13 -0600 Subject: [PATCH 5/5] * revert --- .github/workflows/push-and-pr-testing-ruby-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-and-pr-testing-ruby-ci.yml b/.github/workflows/push-and-pr-testing-ruby-ci.yml index 15b2776..512eef3 100644 --- a/.github/workflows/push-and-pr-testing-ruby-ci.yml +++ b/.github/workflows/push-and-pr-testing-ruby-ci.yml @@ -40,7 +40,7 @@ jobs: # handle IPv6 issues with bundler echo ":ipv4_fallback_enabled: true" > .gemrc export GEMRC=".gemrc" - bundle install -j16 + bundle install - name: Run rubocop run: | bundle exec rake rubocop