New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI on FreeBSD #2589
Comments
Interesting. What happens if you change it to something like: true until @server.gets.include? 'Ctrl-C' |
@MSP-Greg Thanks! Using this diff now there is progress: https://gist.github.com/dentarg/0f3137b724f83818fcacfd95c0bf5560 ( diff --git a/lib/puma/server.rb b/lib/puma/server.rb
index 0b42460c..d0e09a34 100644
--- a/lib/puma/server.rb
+++ b/lib/puma/server.rb
@@ -137,8 +137,6 @@ module Puma
# socket parameter may be an MiniSSL::Socket, so use to_io
#
if tcp_cork_supported?
- UNPACK_TCP_STATE_FROM_TCP_INFO = "C".freeze
-
# 6 == Socket::IPPROTO_TCP
# 3 == TCP_CORK
# 1/0 == turn on/off
@@ -168,6 +166,8 @@ module Puma
end
if closed_socket_supported?
+ UNPACK_TCP_STATE_FROM_TCP_INFO = "C".freeze
+
def closed_socket?(socket)
return false unless socket.kind_of? TCPSocket
return false unless @precheck_closing
diff --git a/test/helpers/integration.rb b/test/helpers/integration.rb
index b13ef2a3..b6a2aff8 100644
--- a/test/helpers/integration.rb
+++ b/test/helpers/integration.rb
@@ -109,7 +109,7 @@ class TestIntegration < Minitest::Test
end while line !~ /Ctrl-C/
puts "Server booted!"
else
- true while @server.gets !~ /Ctrl-C/
+ true until @server.gets.to_s.include?("Ctrl-C")
end
end (Added
|
|
Ah... macOS and Linux:
FreeBSD:
|
Expecting curl to print
|
Does not complete in 45 seconds for me, seems to need about 77 seconds |
...the second time the test is run:
When I ran the full suite (did this before the two runs above), there were some deadlocks: $ time bundle exec rake
...
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [amd64-freebsd12]
RUBYOPT: -r/usr/home/vagrant/.gem/ruby/2.7/gems/bundler-2.2.15/lib/bundler/setup
Puma::MiniSSL OpenSSL
OPENSSL_LIBRARY_VERSION: OpenSSL 1.1.1h-freebsd 22 Sep 2020OpenSSL 1.1.1h-freebsd 22 Sep 2020
OPENSSL_VERSION: OpenSSL 1.1.1h-freebsd 22 Sep 2020OpenSSL 1.1.1h-freebsd 22 Sep 2020
Run options: --seed 19437
# Running:
..........................................................................................................................................................................................................................................................................................................................................F...............................Traceback (most recent call last):
13: from /usr/home/vagrant/puma/bin/puma:10:in `<main>'
12: from /usr/home/vagrant/puma/lib/puma/cli.rb:80:in `run'
11: from /usr/home/vagrant/puma/lib/puma/launcher.rb:181:in `run'
10: from /usr/home/vagrant/puma/lib/puma/cluster.rb:439:in `run'
9: from /usr/home/vagrant/puma/lib/puma/runner.rb:29:in `log'
8: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `log'
7: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `puts'
6: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `write'
5: from /usr/home/vagrant/puma/lib/puma/cluster.rb:316:in `block in setup_signals'
4: from /usr/home/vagrant/puma/lib/puma/launcher.rb:221:in `close_binder_listeners'
3: from /usr/home/vagrant/puma/lib/puma/launcher.rb:366:in `log'
2: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `log'
1: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `puts'
/usr/home/vagrant/puma/lib/puma/events.rb:65:in `write': deadlock; recursive locking (ThreadError)
..Traceback (most recent call last):
13: from /usr/home/vagrant/puma/bin/puma:10:in `<main>'
12: from /usr/home/vagrant/puma/lib/puma/cli.rb:80:in `run'
11: from /usr/home/vagrant/puma/lib/puma/launcher.rb:181:in `run'
10: from /usr/home/vagrant/puma/lib/puma/cluster.rb:439:in `run'
9: from /usr/home/vagrant/puma/lib/puma/runner.rb:29:in `log'
8: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `log'
7: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `puts'
6: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `write'
5: from /usr/home/vagrant/puma/lib/puma/cluster.rb:316:in `block in setup_signals'
4: from /usr/home/vagrant/puma/lib/puma/launcher.rb:221:in `close_binder_listeners'
3: from /usr/home/vagrant/puma/lib/puma/launcher.rb:366:in `log'
2: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `log'
1: from /usr/home/vagrant/puma/lib/puma/events.rb:65:in `puts'
/usr/home/vagrant/puma/lib/puma/events.rb:65:in `write': deadlock; recursive locking (ThreadError)
..................................S................................................
Fabulous run in 278.188612s, 1.6068 runs/s, 4.7953 assertions/s.
Errors & Failures:
1) Failure:
TestIntegrationSingle#test_term_not_accepts_new_connections [/usr/home/vagrant/puma/test/test_integration_single.rb:88]:
Expected /Connection refused|Connection reset by peer/ to match " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 7 100 7 0 0 218 0 --:--:-- --:--:-- --:--:-- 218\n".
447 runs, 1334 assertions, 1 failures, 0 errors, 1 skips
You have skipped tests. Run with --verbose for details.
------------------------------------------------------------ Debugging Info
TestIntegrationSingle#test_hot_restart_does_not_drop_connections_threads
restart_count 13, reset 0, success after restart 972
TestIntegrationSingle#test_hot_restart_does_not_drop_connections
restart_count 30, reset 0, success after restart 494
TestIntegrationCluster#test_hot_restart_does_not_drop_connections_threads
restart_count 19, reset 0, success after restart 2954
TestIntegrationCluster#test_term_closes_listeners_unix
10 successes, 0 resets, 30 refused, failures 0
TestIntegrationCluster#test_term_closes_listeners_tcp
11 successes, 2 resets, 27 refused, failures 0
TestIntegrationCluster#test_hot_restart_does_not_drop_connections
restart_count 59, reset 0, success after restart 995
---------------------------------------------------------------------------
rake aborted!
Command failed with status (1)
Tasks: TOP => default => test:all => test
(See full trace by running task with --trace)
279.97 real 51.58 user 33.10 sys |
The deadlocks does not fail the build. They exist when we run on macOS too: https://github.com/puma/puma/runs/2250467472?check_suite_focus=true#step:9:429 |
I think this test should use the same technique as the cluster mode tests does ( |
Thanks for working on this, both FreeBSD & macOS with the new arch would both be good to add to CI. Do you have a Cirrus CI script? I'd like to run it with https://github.com/MSP-Greg/puma/tree/test-update... |
@MSP-Greg haven't yet tried Cirrus CI in my fork, but the instructions are at https://cirrus-ci.org/guide/FreeBSD/ I'm using Ruby 2.7 from FreeBSD ports over at https://github.com/dentarg/puma-vagrant and I think a complete script to run the tests would look something like this (installing pkg install -y git devel/ragel devel/ruby-gems
gem install bundler
git clone https://github.com/puma/puma.git
cd puma
bundle
bundle exec rake |
@dentarg Getting FreeBSD to run locally (Windows) is probably difficult, so I've got to use Cirrus CI. WSL2 can run Ubuntu and/or Debian. |
@MSP-Greg both VirtualBox and Vagrant are available for Windows: https://www.virtualbox.org/wiki/Downloads, https://www.vagrantup.com/downloads – so I think you can run it if you and your PC are up for it ;-) |
Thanks for the info.
My PC, yes, I went a little overboard a few months ago. Me? I'm staying busy with WSL2/Ubuntu, trying to not get frustrated jumping between bash & PowerShell. I'm doing most of my Puma work in WSL2/Ubuntu... |
I think we can get CI going on FreeBSD using Cirrus CI, from https://cirrus-ci.org/features/:
Even after applying #2588, there are many failing tests (gist with test output), it seems to be all that use
wait_for_server_to_boot
:puma/test/helpers/integration.rb
Lines 102 to 114 in 5e6e073
Anyone has any idea?
The text was updated successfully, but these errors were encountered: