[Bug #3318] net/imap/test_imap.rb reports an error on Windows

Bug #3318: net/imap/test_imap.rb reports an error on Windows
http://redmine.ruby-lang.org/issues/show/3318

e$B5/I<<Te(B: Usaku NAKAMURA
e$B%9%F!<%?%9e(B: Assigned, e$BM%@hEYe(B: Normal
e$BC4Ev<Te(B: Shugo M., e$B%+%F%4%je(B: lib, Target version: 1.9.2
ruby -v: ruby 1.9.3dev (2010-05-19 trunk 27889) [i386-mswin32]

imape$B$N%F%9%H$,0J2<$N$h$&$J%(%i!<$r=P$7$^$9!#e(B

  1. Error:
    test_idle_done_not_during_idle(IMAPTest):
    IOError: closed stream
    C:/ruby/test/net/imap/test_imap.rb:283:in
    `test_idle_done_not_during_idle’

e$B0J2<$N%Q%C%A$GLdBj$O=P$J$/$J$k$s$G$9$,!"$3$l$G$$$$$s$G$7$g$&$+e(B?
e$B<B$Oe(Bsockete$B%l%Y%k$KLdBj$,$"$j$=$&[email protected]$C$?$j$7$^$9$+e(B?

Index: lib/net/imap.rb

— lib/net/imap.rb (revision 27889)
+++ lib/net/imap.rb (working copy)
@@ -311,7 +311,7 @@ module Net
@receiver_thread.raise(e)
end
@receiver_thread.join

  •  @sock.close
    
  •  @sock.close unless @sock.closed?
     raise e if e
    
    end

e$B%A%1%C%He(B #3318 e$B$,99?7$5$l$^$7$?!#e(B (by Shugo M.)

e$B%9%F!<%?%9e(B Assignede$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

This issue was solved with changeset r27903.
Usaku, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


http://redmine.ruby-lang.org/issues/show/3318

e$BA0ED$G$9!#e(B

2010e$BG/e(B5e$B7ne(B19e$BF|e(B18:22 Usaku NAKAMURA
[email protected]:

imape$B$N%F%9%H$,0J2<$N$h$&$J%(%i!<$r=P$7$^$9!#e(B

  1. Error:
    test_idle_done_not_during_idle(IMAPTest):
    IOError: closed stream
    C:/ruby/test/net/imap/test_imap.rb:283:in `test_idle_done_not_during_idle’

e$B0J2<$N%Q%C%A$GLdBj$O=P$J$/$J$k$s$G$9$,!"$3$l$G$$$$$s$G$7$g$&$+e(B?

[email protected]$7$F$_$^$7$?$,$I$&$G$7$g$&$+!#e(B

synchronizee$B$9$k$h$&$K$7$^$7$?$,!"e(Bclosed?e$B$r%A%’%C%/$;$:$Ke(Bclosee$B$7$Fe(BIOErrore$B$re(Brescue

e$B$7$?J}$,$h$$$N$+$b!#e(B

e$B<B$Oe(Bsockete$B%l%Y%k$KLdBj$,$"$j$=$&[email protected]$C$?$j$7$^$9$+e(B?

311e$B9TL$Ne(B

@receiver_thread.raise(e)

e$B$"$?$j$rDL$C$F$$$k5$$,$9$k$N$G$9$,!"$I$s$JNc30$,H/@8$7$F$$$k$+65$($Fe(B
[email protected]$1$k$H2?$+$o$+$k$+$b$7$l$^$;$s!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:41360] Re: [Bug #3318] net/imap/test_imap.rb
reports an error on Windows”
on May.19,2010 23:27:37, [email protected] wrote:

[email protected]$7$F$_$^$7$?$,$I$&$G$7$g$&$+!#e(B

synchronizee$B$9$k$h$&$K$7$^$7$?$,!"e(Bclosed?e$B$r%A%’%C%/$;$:$Ke(Bclosee$B$7$Fe(BIOErrore$B$re(Brescue

e$B$7$?J}$,$h$$$N$+$b!#e(B

e$B$H$j$"$($:!"%F%9%H$N<:GT<+BN$O$J$/$J$j$^$7$?!#e(B
e$B$"$j$,$H$&$4$6$$$^$9!#e(B

e$B<B$Oe(Bsockete$B%l%Y%k$KLdBj$,$"$j$=$&[email protected]$C$?$j$7$^$9$+e(B?

311e$B9TL$Ne(B

@receiver_thread.raise(e)

e$B$"$?$j$rDL$C$F$$$k5$$,$9$k$N$G$9$,!"$I$s$JNc30$,H/@8$7$F$$$k$+65$($Fe(B
[email protected]$1$k$H2?$+$o$+$k$+$b$7$l$^$;$s!#e(B

e$B$^[email protected]$"$s$^$j??LLL$KDI$C$F$J$$$s$G$9$,!"e(B306e$B9TL$Ne(B
@sock.shutdown
e$B$Ge(B #<RuntimeError: error> e$B$,H/@8$7$F$$$^$9!#e(B
(e$B$Ge(B311e$B9TL$rDL$C$F$$$^$9e(B)
e$B$J$<$Ke(BRuntimeErrore$B$J$s$G$7$g$&e(B…

e$B$=$l$G$O!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:41371] Re: [Bug #3318] net/imap/test_imap.rb
reports an error on Windows”
on May.20,2010 16:50:31, [email protected] wrote:

(e$B$Ge(B311e$B9TL$rDL$C$F$$$^$9e(B)
e$B$F$$$?$j$H$+!D$C$F$3$H$O$J$$$G$9$h$M!#e(B
e$B$&!<$s!"[email protected]$m$&!#e(B

e$B$&$o!"$9$_$^$;$s!"4V0c$C$?=PNO$r8+$F$^$7$?e(B orz
e$B$^$5$K$=$Ne(Btest_exception_during_shutdowne$B$G4|BTDL$j$NNc30$,5/e(B
e$B$-$F$k$H$3$m$r4V0c$($FDI$C$F$^$7$?e(B…

e$B$G!"2~$a$F!“e(Btest_idle_done_not_during_idlee$B$NJ}$G$9$,!”@5>o$Ke(B
e$B4|BT$5$l$k%Q%9$rDL$C$F!"LdBj$Ne(B @sock.close
e$B$K$^$GC)$j$D$$$F$$e(B
e$B$^$7$?!#e(B
e$B$G$O$I$3$Ge(Bclosee$B$5$l$F$k$+$H$$$&$H!"e(Bnet/imap.rbe$B$Ne(B1039e$B9TL!“e(B
receive_responsese$BFb$Ne(Brescuee$B$N$H$3$m$G$9!#e(B
e$B$G!”$=$Ne(Brescuee$B$KF~$k860x$H$J$C$?Nc30$Oe(B1110e$B9TL!"e(Bget_response
e$B$G5/$-$F$^$9!#e(B

#<Errno::ESHUTDOWN:
e$B%=%1%C%H$,0JA0$N%7%c%C%H%@%&%s$N8F$S=P$7$G%7%c%C%H%@%&%s$5$l$F$$$k$?$a!"%G!<%?$NAw<u?.$rMW5a$9$k$3$H$O6X$8$i$l$F$$$^$9!#e(B>

e$B$$$d$"e(Bwinsocke$B$N=P$9%a%C%;!<%8$O$o$+$j$d$9$$e(B

e$B$H$$$&$o$1$G!“e(Bdisconnecte$BFb$Ge(Bshutdowne$B$r<B9T$7$?;[email protected]$G$OJL%9%le(B
e$B%C%I$Ne(Bget_responsee$B$,$^[email protected]<B9TCf$G$”$k$H$$$&$3$H$K$J$j$^$9$,!"e(B
e$B$3$N%F%9%HE*$K$=$l$,@5$7$$$+$I$&$+$,2x$7$$$H$$$&$3$H$K$J$k$se(B
e$B$G$7$g$&$+$Me(B?

e$B$=$l$G$O!#e(B

e$BA0ED$G$9!#e(B

2010e$BG/e(B5e$B7ne(B20e$BF|e(B15:41 U.Nakamura [email protected]:

[email protected]$7$F$_$^$7$?$,$I$&$G$7$g$&$+!#e(B

synchronizee$B$9$k$h$&$K$7$^$7$?$,!"e(Bclosed?e$B$r%A%’%C%/$;$:$Ke(Bclosee$B$7$Fe(BIOErrore$B$re(Brescue

e$B$7$?J}$,$h$$$N$+$b!#e(B

e$B$H$j$"$($:!"%F%9%H$N<:GT<+BN$O$J$/$J$j$^$7$?!#e(B
e$B$"$j$,$H$&$4$6$$$^$9!#e(B

e$BN;2r$G$9!#e(B

     @sock.shutdown

e$B$Ge(B #<RuntimeError: error> e$B$,H/@8$7$F$$$^$9!#e(B
(e$B$Ge(B311e$B9TL$rDL$C$F$$$^$9e(B)
e$B$J$<$Ke(BRuntimeErrore$B$J$s$G$7$g$&e(B…

test_exception_during_shutdowne$B$Ge(B

      def @sock.shutdown(*args)
        super
        raise "error"
      end

e$B$H$+$7$F$k$s$G$9$1$I!"e([email protected]$He(BTCPSockete$B$N%$%s%9%?%s%9$,;H$$2s$5$le(B
e$B$F$$$?$j$H$+!D$C$F$3$H$O$J$$$G$9$h$M!#e(B
e$B$&!<$s!"[email protected]$m$&!#e(B