summaryrefslogtreecommitdiff
path: root/test/net/smtp/test_smtp.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-12-29 22:02:46 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2020-12-29 22:02:48 -0800
commit15c129d08790878444f3ecbdef0f8fe15eed06f4 (patch)
treeea3a3d972b7b813cc798eaf3c8c386123f481a20 /test/net/smtp/test_smtp.rb
parent8e231ffa8c4fde25998f827cb965c4fd7d55c53d (diff)
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/test_smtp.rb')
-rw-r--r--test/net/smtp/test_smtp.rb11
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