harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Harley (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-658) Remove an unstable test from DatagramChannelTest.java
Date Mon, 26 Jun 2006 13:50:43 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-658?page=all ]
     
George Harley resolved HARMONY-658:
-----------------------------------

    Resolution: Fixed

Hi Andrew, 

Thanks for this change. Patch committed in revision 417192; please could you verify that it
has been applied as expected. 

Best regards, 
George


> Remove an unstable test from DatagramChannelTest.java
> -----------------------------------------------------
>
>          Key: HARMONY-658
>          URL: http://issues.apache.org/jira/browse/HARMONY-658
>      Project: Harmony
>         Type: Test

>   Components: Classlib
>     Reporter: Andrew Zhang
>     Assignee: George Harley
>  Attachments: nio.diff
>
> Hello, 
> Consider following test from DatagramChannelTest.java, which is potentially unstable.
> The test can not guarantee that channel1.receive always executes before channel1.close.

> Therefore, the test may fail sometimes.
>  private void closeBlockedChannelForReceive(ByteBuffer dst)
>             throws IOException {
>         // TODO refine async close test when AbstractInterruptibleChannel
>         // complete
>         // to break the blocking status, let a thread to close this channel.
>         new Thread() {
>             public void run() {
>                 try {
>               // Can not guarantee that channel1.receive always executes before channel1.close.

>               // Therefore, the test may fail. 
>                     Thread.sleep(TIME_UNIT);
>                     channel1.close();
>                 } catch (Exception e) {
>                     e.printStackTrace();
>                 }
>             }
>         }.start();
>         try {
>             this.channel1.receive(dst);
>             fail("Should throw a AsynchronousCloseException");
>         } catch (AsynchronousCloseException e) {
>             //expected
>         }
>     }
> I'll remove the test from DatagramChannelTest.java. 
> Thanks!
> Best regards,
> Andrew

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message