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/27 03:50:30 UTC
[jira] Commented: (HARMONY-658) Remove an unstable test from
DatagramChannelTest.java
[ 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