harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-658) Remove an unstable test from DatagramChannelTest.java
Date Mon, 26 Jun 2006 03:33:29 GMT
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


Mime
View raw message