You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "George Harley (JIRA)" <ji...@apache.org> on 2006/06/26 15:50:43 UTC

[jira] Resolved: (HARMONY-658) Remove an unstable test from DatagramChannelTest.java

     [ 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