summaryrefslogtreecommitdiff
path: root/test/net/imap/test_imap.rb
AgeCommit message (Collapse)Author
2021-05-27Promote net-imap to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-06[ruby/net-imap] Move UTF7 & datetime formatting to net/imap/data_encodingnicholas a. evans
Partially implements #10. https://github.com/ruby/net-imap/commit/0d43c5e856
2021-05-04test/net/imap/test_imap.rb: wait a moment before socket is closedYusuke Endoh
to try to suppress a failure on Solaris. This is the same as 19504d115dc09558255fcb5213f80dd8454ab189 http://rubyci.s3.amazonaws.com/solaris11-sunc/ruby-master/log/20210504T070007Z.fail.html.gz ``` 1) Error: IMAPTest#test_idle_done_not_during_idle: Errno::EINVAL: Invalid argument - connect(2) for [::1]:33839 /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:1214:in `__connect_nonblock' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:1214:in `connect_nonblock' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:56:in `connect_internal' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:137:in `connect' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:642:in `block in tcp' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:227:in `each' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:227:in `foreach' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:632:in `tcp' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/lib/net/imap.rb:1223:in `tcp_socket' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/lib/net/imap.rb:1180:in `initialize' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/test/net/imap/test_imap.rb:289:in `new' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/test/net/imap/test_imap.rb:289:in `test_idle_done_not_during_idle' ```
2021-04-22Merge net-imap-0.2.0Hiroshi SHIBATA
2020-06-05`local_address` may raise IOError in debug printKazuhiro NISHIYAMA
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' ```
2020-06-05Add sockets to debug printKazuhiro NISHIYAMA
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}} >. ```
2020-01-29Add more debug printKazuhiro NISHIYAMA
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20200129T022510Z.fail.html.gz
2020-01-26Add more debug printKazuhiro NISHIYAMA
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"}>. ```
2019-12-15Add more debug infoKazuhiro NISHIYAMA
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"}>. ```
2019-12-12Move `rescue` for debug into block of assert_raiseKazuhiro NISHIYAMA
2019-12-12Add more debug info when Errno::EINVALKazuhiro NISHIYAMA
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20191212T072406Z.fail.html.gz
2019-06-30Removed unused variablesNobuyoshi Nakada
2019-06-25test/net/imap/test_imap.rb: use Thread#stop? to wait for server threadYusuke Endoh
Still timeout occurs. Retry for 5dd8fdd3f328f741fae4abba00c478e8a51d2a7e. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20190625T032405Z.fail.html.gz
2019-06-15test/net/imap/test_imap.rb: wait for the server thread to startYusuke Endoh
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
2018-10-21Exclude CI platform specific failures by --excludes optionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21skip tests broken with OpenSSL 1.1.1 on Travis osxk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16test/net/imap/test_imap.rb (test_exception_during_idle): kill infinite loopernormal
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
2018-05-11net/imap: Fix ArgumentError in send_string_datashugo
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
2017-12-12Fix test-all tests to avoid creating report_on_exception warningseregon
* 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
2017-10-22Fixed misspelling words.hsbt
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
2017-08-27lib/net/imap.rb: Accept continuation requests without response textshugo
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
2017-08-18test/net/imap/test_imap.rb: Use Addrinfo.tcp in case localhost is ::1.shugo
[ruby-dev:50208] [Bug #13825] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-22net/imap: separate @continuation_request_exception from @exceptionshugo
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
2017-05-19net/imap: Net::IMAP#append should not block when NO response is receivedshugo
[ruby-dev:50129] [Bug#13579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-13test/net/imap: fix race condition in test_exception_during_idleshugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-11net/imap: Net::IMAP#disconnect need not do anything if already disconnectedshugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19Move certificates to test/net/fixtures/.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-07* test/net/imap/test_imap.rb (test_idle_timeout): Because of theodaira
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
2015-10-240.1 second is not enough for FreeBSDnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23* lib/net/imap.rb: remove an empty comment line and -*-.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-22* lib/net/imap (idle): add a new argument timeout for keep-alive.shugo
[ruby-core:63693] [Bug #10031] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-09* lib/net/imap.rb: use frozen_string_literal: true.shugo
* 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
2014-12-07* test/net/imap/test_imap.rb (ImapTest#imaps_test): forced error on SSL socketsusa
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
2014-12-06* lib/net/imap.rb: Fix undefined variable usage & refactor/DRYshugo
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
2014-11-10* test/net/imap/test_imap.rb: Don't ignore exceptions on serverakr
threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28No need to kill a thread.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28* lib/net/imap.rb (Net::IMAP#initialize): Close the opened socket whenakr
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
2014-05-26test_imap.rb: fix leaked threadsnobu
* 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
2014-02-23* test/net/imap/test_imap.rb: remove unused variables.hsbt
* 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
2012-05-09* lib/net/imap.rb (decode_utf7, encode_utf7): refactored byshugo
Nobuyoshi Nakada, to use String#encode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-23skip OpenSSL dependent tests if not availablenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16* lib/net/imap.rb (initialize): raise Net::IMAP::Error when theshugo
connection is closed without a greeting response. [ruby-core:40938] [Bug #5616] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-04* lib/net/imap.rb (default_port, default_imap_port,shugo
default_tls_port, default_ssl_port, default_imaps_port): added methods for consistency with Net::POP. based on the patch by art lussos. [ruby-core:38997] [Bug #5198] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-19* lib/net/imap.rb (idle): raises a Net::IMAP::Error when theshugo
connection is closed. based on the patch by Hugo Barauna. [Bug #5190] [ruby-core:38930] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-14* test/net/imap/test_imap.rb: call neither logout nor disconnectshugo
unless connected. patch by Kazuhiro NISHIYAMA. [ruby-dev:42860] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-27 * test/net/imap/test_imap.rb: resurrection of r29259.shyouhei
this change depends on minitest 1.7.1. * lib/test/unit/assertions.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-15reverting; ↵shyouhei
http://rubyforge.org/tracker/?func=detail&atid=4099&aid=28566&group_id=1040 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-15 * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):shyouhei
should properly ignore MiniTest::Skip * lib/minitest/unit.rb (MiniTest::Assertions::assert_raises): ditto. * test/net/imap/test_imap.rb: Properly skip SSL tests when localhost is not 127.0.0.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-15 * test/net/imap/test_imap.rb: "localhost" not guaranteed toshyouhei
resolve to "127.0.0.1". On my machine it is "::1" instead. The problem is, you have to connect to the imaps server via the canonical name written in a server certificate, and that of the server.cert is "localhost". So you have to listen to the address of what "localhost" resolves to. I think this situation cannot be resolved in a handy manner because the test "test_imaps_post_connection_check" is actually expecting to connect to a server via an address other than the CN. On my machine several assertions won't pass because the test cannot connect to the server. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05* test/net/imap/test_imap.rb (test_exception_during_shutdown):nobu
need to raise always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e