diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-12-29 22:02:46 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-12-29 22:02:48 -0800 |
commit | 15c129d08790878444f3ecbdef0f8fe15eed06f4 (patch) | |
tree | ea3a3d972b7b813cc798eaf3c8c386123f481a20 /test/net/smtp | |
parent | 8e231ffa8c4fde25998f827cb965c4fd7d55c53d (diff) | |
download | ruby-15c129d08790878444f3ecbdef0f8fe15eed06f4.tar.gz |
Try increasing SMTP's read_timeout for --jit-wait
for random hangs like:
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3302796
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3302188
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3301293
Diffstat (limited to 'test/net/smtp')
-rw-r--r-- | test/net/smtp/test_smtp.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/net/smtp/test_smtp.rb b/test/net/smtp/test_smtp.rb index af30bb7221..e909909dec 100644 --- a/test/net/smtp/test_smtp.rb +++ b/test/net/smtp/test_smtp.rb @@ -29,6 +29,17 @@ module Net end def setup + # Avoid hanging at fake_server_start's IO.select on --jit-wait CI like http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3302796 + # Unfortunately there's no way to configure read_timeout for Net::SMTP.start. + if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? + Net::SMTP.prepend Module.new { + def initialize(*) + super + @read_timeout *= 5 + end + } + end + @server_threads = [] end |