summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-06-21 02:14:32 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2020-06-21 02:14:34 -0700
commitec07e2de1a15ac8ab54b6275c8d09aa615fbb1db (patch)
tree840899a09e23a5c3b677e6a4ae91bd531bab2cf8 /test/net
parent426db4cd90c9539118c62ade917d936ce2e99be0 (diff)
Increase read timeout of FTP tests with --jit-wait
Trying to eliminate some newer random failures http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3016543
Diffstat (limited to 'test/net')
-rw-r--r--test/net/ftp/test_ftp.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb
index e75e7e5..0907df5 100644
--- a/test/net/ftp/test_ftp.rb
+++ b/test/net/ftp/test_ftp.rb
@@ -1545,6 +1545,7 @@ EOF
begin
begin
ftp = Net::FTP.new
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
ftp.connect(SERVER_ADDR, server.port)
assert_equal(['LANG EN*', 'UTF8'], ftp.features)
assert_equal("FEAT\r\n", commands.shift)
@@ -1567,6 +1568,7 @@ EOF
begin
begin
ftp = Net::FTP.new
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
ftp.connect(SERVER_ADDR, server.port)
assert_raise(Net::FTPPermError) do
ftp.features
@@ -1592,6 +1594,7 @@ EOF
begin
begin
ftp = Net::FTP.new
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
ftp.connect(SERVER_ADDR, server.port)
ftp.option("UTF8", "ON")
assert_equal("OPTS UTF8 ON\r\n", commands.shift)
@@ -1650,6 +1653,7 @@ EOF
begin
begin
ftp = Net::FTP.new
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
ftp.connect(SERVER_ADDR, server.port)
entry = ftp.mlst("foo")
assert_equal("/foo", entry.pathname)
@@ -1736,6 +1740,7 @@ EOF
begin
begin
ftp = Net::FTP.new
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
ftp.connect(SERVER_ADDR, server.port)
ftp.login
assert_match(/\AUSER /, commands.shift)
@@ -1774,6 +1779,7 @@ EOF
def test_parse257
ftp = Net::FTP.new
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
assert_equal('/foo/bar',
ftp.send(:parse257, '257 "/foo/bar" directory created'))
assert_equal('/foo/bar"baz',
@@ -1912,6 +1918,7 @@ EOF
port: port,
ssl: { ca_file: CA_FILE },
passive: false)
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
begin
assert_equal("AUTH TLS\r\n", commands.shift)
assert_equal("PBSZ 0\r\n", commands.shift)
@@ -1996,6 +2003,7 @@ EOF
port: port,
ssl: { ca_file: CA_FILE },
passive: true)
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
begin
assert_equal("AUTH TLS\r\n", commands.shift)
assert_equal("PBSZ 0\r\n", commands.shift)
@@ -2071,6 +2079,7 @@ EOF
ssl: { ca_file: CA_FILE },
private_data_connection: false,
passive: false)
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
begin
assert_equal("AUTH TLS\r\n", commands.shift)
ftp.login
@@ -2140,6 +2149,7 @@ EOF
ssl: { ca_file: CA_FILE },
private_data_connection: false,
passive: true)
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
begin
assert_equal("AUTH TLS\r\n", commands.shift)
ftp.login
@@ -2332,6 +2342,7 @@ EOF
chdir_to_tmpdir do
begin
ftp = Net::FTP.new
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
ftp.connect(SERVER_ADDR, server.port)
ftp.login
assert_match(/\AUSER /, commands.shift)
@@ -2382,7 +2393,7 @@ EOF
File.binwrite("./|echo hello", binary_data)
begin
ftp = Net::FTP.new
- ftp.read_timeout = 0.2
+ ftp.read_timeout = RubyVM::MJIT.enabled? ? 300 : 0.2 # use large timeout for --jit-wait
ftp.connect(SERVER_ADDR, server.port)
ftp.login
assert_match(/\AUSER /, commands.shift)
@@ -2437,6 +2448,7 @@ EOF
end
begin
ftp = Net::FTP.new
+ ftp.read_timeout *= 5 if RubyVM::MJIT.enabled? # for --jit-wait
ftp.connect(SERVER_ADDR, server.port)
ftp.login
assert_match(/\AUSER /, commands.shift)