aboutsummaryrefslogtreecommitdiffstats
path: root/test/net/imap
Commit message (Collapse)AuthorAgeFilesLines
* `local_address` may raise IOError in debug printKazuhiro NISHIYAMA2020-06-051-1/+1
| | | | | | | | | | | | | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/wsl2/ruby-master/log/20200605T020004Z.fail.html.gz ``` [ 984/20282] IMAPTest#test_connection_closed_without_greeting#<Thread:0x000055b6e9589d28 /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:133 run> terminated with exception (report_on_exception is true): /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/.ext/common/socket.rb:252:in `local_address': closed stream (IOError) from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/.ext/common/socket.rb:252:in `connect_address' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `block (2 levels) in test_connection_closed_without_greeting' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `each_object' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `each' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `map' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `block in test_connection_closed_without_greeting' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:134:in `block in start_server' ```
* Add sockets to debug printKazuhiro NISHIYAMA2020-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debug print does not include `in_tcp_socket_2`, so I think other socket connected to server socket. Add sockets to debug print, and check other socket is in same process or not. https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200604T160009Z.fail.html.gz ``` 1) Failure: IMAPTest#test_connection_closed_without_greeting [/export/home/chkbuild/chkbuild-gcc/tmp/build/20200604T160009Z/ruby/test/net/imap/test_imap.rb:523]: [Net::IMAP::Error] exception expected, not #<RuntimeError: {:server=>#<TCPServer:(closed)>, :port=>35490, :server_created=> {:server=>"#<TCPServer:fd 10, AF_INET6, ::1, 35490>", :t=>45917010.30510591}, :in_start_server_before_accept=>{:t=>45917010.305154555}, :in_tcp_socket=> {:host=>"::1", :port=>35490, :server=>"#<TCPServer:fd 10, AF_INET6, ::1, 35490>", :t=>45917010.40560127}, :in_start_server=> {:sock_addr=>["AF_INET6", 35490, "::1", "::1"], :sock_peeraddr=>["AF_INET6", 51584, "::1", "::1"], :t=>45917010.40767231}, :in_start_server_sock_closed=>{:t=>45917010.40770047}, :in_rescue=> {:e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:35490>, :server_addr=>"::1", :t=>45917010.40867455}} >. ```
* Add more debug printKazuhiro NISHIYAMA2020-01-291-2/+11
| | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20200129T022510Z.fail.html.gz
* Add more debug printKazuhiro NISHIYAMA2020-01-261-9/+49
| | | | | | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20200125T032406Z.fail.html.gz ``` IMAPTest#test_connection_closed_without_greeting [/export/home/rubyci/chkbuild-tmp/tmp/build/20200125T032406Z/ruby/test/net/imap/test_imap.rb:485]: [Net::IMAP::Error] exception expected, not #<RuntimeError: {:"server before close"=>"#<TCPServer:fd 10, AF_INET6, ::1, 48515>", :sock_addr=>["AF_INET6", 48515, "::1", "::1"], :sock_peeraddr=>["AF_INET6", 35223, "::1", "::1"], :e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:48515>, :server=>#<TCPServer:(closed)>, :port=>48515, :server_addr=>"::1"}>. ```
* Add more debug infoKazuhiro NISHIYAMA2019-12-151-1/+8
| | | | | | | | | | | | | closed server doesn't have useful info. So call inspect before close. And add local debug code in comment. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20191215T092405Z.fail.html.gz ``` 1) Failure: IMAPTest#test_connection_closed_without_greeting [/export/home/rubyci/chkbuild-tmp/tmp/build/20191215T092405Z/ruby/test/net/imap/test_imap.rb:483]: [Net::IMAP::Error] exception expected, not #<RuntimeError: {:e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:41748>, :server=>#<TCPServer:(closed)>, :port=>41748, :server_addr=>"::1"}>. ```
* Move `rescue` for debug into block of assert_raiseKazuhiro NISHIYAMA2019-12-121-2/+2
|
* Add more debug info when Errno::EINVALKazuhiro NISHIYAMA2019-12-121-0/+2
| | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20191212T072406Z.fail.html.gz
* Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans2019-11-181-19/+19
| | | | | | This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby.
* Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans2019-11-181-13/+0
| | | | | | | | | | | | | | | | | This removes the security features added by $SAFE = 1, and warns for access or modification of $SAFE from Ruby-level, as well as warning when calling all public C functions related to $SAFE. This modifies some internal functions that took a safe level argument to no longer take the argument. rb_require_safe now warns, rb_require_string has been added as a version that takes a VALUE and does not warn. One public C function that still takes a safe level argument and that this doesn't warn for is rb_eval_cmd. We may want to consider adding an alternative method that does not take a safe level argument, and warn for rb_eval_cmd.
* Removed unused variablesNobuyoshi Nakada2019-06-301-2/+1
|
* test/net/imap/test_imap.rb: use Thread#stop? to wait for server threadYusuke Endoh2019-06-251-4/+3
| | | | | Still timeout occurs. Retry for 5dd8fdd3f328f741fae4abba00c478e8a51d2a7e. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20190625T032405Z.fail.html.gz
* test/net/imap/test_imap.rb: wait for the server thread to startYusuke Endoh2019-06-151-14/+29
| | | | | | | | | In some slow CI environments, the invocation of a thread seems very slow. This causes a test failure to attempt to connect a server that does not start yet. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20190615T002420Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20190611T022407Z.fail.html.gz
* test/net/fixtures/Makefile: moved from test/net/imapmrkn2019-01-021-15/+0
| | | | | | | | | This Makefile can be used to update test certificates. It should have been moved at which the certificates was moved at r56836. [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Exclude CI platform specific failures by --excludes optionnobu2018-10-211-5/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip tests broken with OpenSSL 1.1.1 on Travis osxk0kubun2018-10-211-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/net/imap/test_imap.rb (test_exception_during_idle): kill infinite loopernormal2018-08-161-1/+3
| | | | | | | | | | | | | | | | It is possible for Mutex#sleep (via ConditionVariable#wait) to prematurely wake up under MJIT (because Mutex#sleep can't handle spurious wakeups). This affects @idle_done_cond in Net::IMAP#idle and means the response handler may never set `in_idle' to `true`. In any case, ensure the infinite looping `raiser' thread stops running when the test is done. Will work on reducing the effect of spurious wakeups from MJIT... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/imap: Fix ArgumentError in send_string_datashugo2018-05-111-0/+37
| | | | | | | Thanks to ShockwaveNN (Pavel Lobashov) for reporting the bug. [ruby-core:86990] [Bug #14750] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* `$SAFE` as a process global state. [Feature #14250]ko12017-12-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state. * vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc` objects don't need to keep `$SAFE` at the creation. Also make `is_from_method` and `is_lambda` as 1 bit fields. * cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation. * eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access `vm->safe_level_` directly. * eval_jump.c: End procs `END{}` doesn't keep `$SAFE`. * proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c. * safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes. * safe.c (safe_setter): use `rb_set_safe_level()`. * thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`. It should be obsolete. * transcode.c (load_transcoder_entry): `rb_safe_level()` only returns 0 or 1 so that this check is not needed. * vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc. * vm.c (rb_proc_create): renamed to `proc_create`. * vm.c (rb_proc_dup): moved from proc.c. * vm.c (vm_invoke_proc): do not need to set and restore `$SAFE` for `Proc#call`. * vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer meaning. * lib/drb/drb.rb: restore `$SAFE`. * lib/erb.rb: restore `$SAFE`, too. * test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests. * test/rubygems/test_gem.rb: do not set `$SAFE = 1`. * bootstraptest/test_proc.rb: catch up this change. * spec/ruby/optional/capi/string_spec.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. * test/fiddle/test_func.rb: ditto. * test/fiddle/test_handle.rb: ditto. * test/net/imap/test_imap_response_parser.rb: ditto. * test/pathname/test_pathname.rb: ditto. * test/readline/test_readline.rb: ditto. * test/ruby/test_file.rb: ditto. * test/ruby/test_optimization.rb: ditto. * test/ruby/test_proc.rb: ditto. * test/ruby/test_require.rb: ditto. * test/ruby/test_thread.rb: ditto. * test/rubygems/test_gem_specification.rb: ditto. * test/test_tempfile.rb: ditto. * test/test_tmpdir.rb: ditto. * test/win32ole/test_win32ole.rb: ditto. * test/win32ole/test_win32ole_event.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix test-all tests to avoid creating report_on_exception warningseregon2017-12-121-0/+1
| | | | | | | | | * The warnings are shown by Thread.report_on_exception defaulting to true. [Feature #14143] [ruby-core:83979] * Improves tests by narrowing down the scope where an exception is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fixed misspelling words.hsbt2017-10-222-3/+3
| | | | | | These are detected by https://github.com/client9/misspell git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/imap.rb: Accept continuation requests without response textshugo2017-08-272-2/+10
| | | | | | | The IMAP server of DOCOMO returns such continuation requests. [ruby-list:50558] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/net/imap/test_imap.rb: Use Addrinfo.tcp in case localhost is ::1.shugo2017-08-181-19/+21
| | | | | | [ruby-dev:50208] [Bug #13825] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/imap.rb: support CHANGEDSINCE and MODSEQshugo2017-07-261-0/+7
| | | | | | Patch by plehoux (Philippe-Antoine Lehoux). [ruby-core:64272] [Feature #10119] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Servershugo2017-07-191-0/+13
| | | | | | | Based on the patch by keysen (Jérémy Carlier). [ruby-core:81641] [Bug #13649] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/imap: separate @continuation_request_exception from @exceptionshugo2017-05-221-4/+7
| | | | | | | Otherwise literal data will be sent even if NO response is returned because @exception is set to nil in receive_responses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/imap: Net::IMAP#append should not block when NO response is receivedshugo2017-05-191-0/+85
| | | | | | [ruby-dev:50129] [Bug#13579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/net/imap: fix race condition in test_exception_during_idleshugo2017-05-131-4/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/imap: Net::IMAP#disconnect need not do anything if already disconnectedshugo2017-05-111-0/+27
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Move certificates to test/net/fixtures/.shugo2016-11-194-132/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/net/imap/test_imap.rb (test_idle_timeout): Because of theodaira2016-03-071-10/+22
| | | | | | | | | timeout specified in "imap.idle(0.2)", there is no gurantee that the server thread has done all the work before the client thread performs the assertions. It depends on the thread scheduling. Add checks to avoid false positives (on AIX, particularly). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 0.1 second is not enough for FreeBSDnaruse2015-10-241-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb: remove an empty comment line and -*-.shugo2015-10-232-4/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap (idle): add a new argument timeout for keep-alive.shugo2015-10-221-0/+44
| | | | | | [ruby-core:63693] [Bug #10031] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb: use frozen_string_literal: true.shugo2015-10-092-3/+9
| | | | | | | | * test/net/imap/test_imap.rb: ditto. * test/net/imap/test_imap_response_parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dspshugo2015-05-081-0/+13
| | | | | | is omitted. [ruby-core:69093] [Bug #11128] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/net/imap/test_imap.rb (ImapTest#imaps_test): forced error on SSL socketsusa2014-12-071-1/+1
| | | | | | | | | causes Errno::ECONNRESET or Errno::ECONNABORTED instead of Errno::EPIPE on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb: Fix undefined variable usage & refactor/DRYshugo2014-12-061-0/+50
| | | | | | | | code. Patch by @aledovsky. [Fixes GH-770] * test/net/test_imap.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb (search_response): parse MODSEQ in SEARCHshugo2014-11-131-0/+8
| | | | | | responses properly. [ruby-core:64203] [Bug #10112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/net/imap/test_imap.rb: Don't ignore exceptions on serverakr2014-11-101-221/+174
| | | | | | | | threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/net/imap/test_imap_response_parser.rb: removed needless code.hsbt2014-08-291-4/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fold too long linenobu2014-06-091-1/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb (body_type_1part): Gmail IMAP reports a bodyshugo2014-06-031-0/+10
| | | | | | | type as "MIXED" followed immediately by params [ruby-core:62864] [Bug #9885] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* No need to kill a thread.akr2014-05-281-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb (Net::IMAP#initialize): Close the opened socket whenakr2014-05-281-12/+13
| | | | | | | | | | | any exception occur. This fixes a fd leak by IMAPTest#test_imaps_post_connection_check which start_tls_session() raises an exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_imap.rb: fix leaked threadsnobu2014-05-261-12/+25
| | | | | | | * test/net/imap/test_imap.rb (imaps_test): join work threads not to leak threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/net/imap/test_imap.rb: remove unused variables.hsbt2014-02-232-3/+1
| | | | | | | * test/net/imap/test_imap_response_parser.rb: ditto. * test/net/pop/test_pop.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/net/imap/test_imap.rb: fix test failures due to expired certstmm12014-01-033-78/+86
| | | | | | | | | | * test/net/imap/cacert.pem: generate new CA cert, since the last one expired. [Bug #9341] [ruby-core:59459] * test/net/imap/server.crt: new server cert signed with updated CA. * test/net/imap/Makefile: add `make regen_certs` to automate this process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb (capability_response): should ignore trailingshugo2013-06-051-0/+11
| | | | | | | | spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415] * test/net/imap/test_imap_response_parser.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb (getacl_response): parse the mailbox of an ACLshugo2013-04-231-0/+14
| | | | | | response correctly. [ruby-core:54365] [Bug #8281] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/imap.rb (body_type_msg): should acceptshugo2013-04-191-0/+43
| | | | | | | | | message/delivery-status with extra data. [ruby-core:53741] [Bug #8167] * test/net/imap/test_imap_response_parser.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e