Closed marshall-lee closed 5 years ago
@julik @toland
It seems that HTTPS doesn't work with fork()
not only with SecureTransport but with OpenSSL too.
I'm not sure it should really work with fork at all — sharing SSL state between processes always create problems.
also: https://stackoverflow.com/questions/15466809/libcurl-ssl-error-after-fork
UPD It works on OpenSSL, it was just a typo in spec: de3cd56.
Also I don't know how to fix specs that use /wrongcontentlength
endpoint with HTTPS connection and I'm not sure they're really fixable.
Ohlala
I commented out two failing ssl specs which I doubt they're even repairable in
976c669.
Also I make PatronTestServer
to run in a separate process instead of thread because Puma and RSpec handles SIGINT
differently: 8758b83.
@toland @julik WDYT?
It looks fine to me. However, at this point, @julik knows this code far better than I do. I will defer to him.
I was out sick. This is some great work @marshall-lee , thank you. I didn't realise threading was so problematic in this configuration. I can't agree that removing Webrick tests was a bad idea though because it was exquisitely hard to test "slow" responses with it anyway.
@julik I did all the final fixes
Thank you for your changes!
Puma migration in f905d35 didn't go well. Some specs are failing due to the following problems:
GzipServlet
does not seeZlib
.GzipServlet
should respond withContent-Length
(WEBRick did it automatically).BodyReadback
should useCONTENT_TYPE
instead ofHTTP_CONTENT_TYPE
.The reason that we don't see them failing is that part of the specs were even not running: some of the spec examples sets
trap('INT')
that does the global exit (added in ba2161c). One should never settrap
handlers inside tests since they're global to the running process.Such a trap handler overwrites the one set by RSpec (btw RSpec's
SIGINT
handler is already overwritten by Puma that's not good too).If you run
rspec ./spec/session_spec.rb
you'd see:But that file contains more than 23 examples, it should be 88.