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

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

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


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


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

Posted by "George Harley (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-658?page=all ]
     
George Harley closed HARMONY-658:
---------------------------------


Verified by Andrew.

> 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


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

Posted by "George Harley (JIRA)" <ji...@apache.org>.
     [ 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


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

Posted by "George Harley (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-658?page=all ]

George Harley reassigned HARMONY-658:
-------------------------------------

    Assign To: George Harley

> 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


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

Posted by "Andrew Zhang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-658?page=all ]

Andrew Zhang updated HARMONY-658:
---------------------------------

    Attachment: nio.diff

Hello,

Would you please try my patch?

Thanks a lot!


Best regards,
Andrew

> 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
>  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


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

Posted by "Andrew Zhang (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-658?page=comments#action_12417943 ] 

Andrew Zhang commented on HARMONY-658:
--------------------------------------

Hello George,

The fix looks good, many thanks!

Best regards,
Andrew

> 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