[ 
https://issues.apache.org/jira/browse/HDFS-10652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384841#comment-15384841
 ] 

Yongjun Zhang commented on HDFS-10652:
--------------------------------------

HI [~vinayrpet],

The test needs the following code to throw exception, but it's not guaranteed,
{code}
            int count = 0;
            while (count < 5) {
              if (replicaInfo.getBytesAcked() < replicaInfo.getBytesOnDisk()) {
                failed.set(true);
                throw new IOException("Failing Pipeline " + replicaInfo
                    .getBytesAcked() + " : " + replicaInfo.getBytesOnDisk());
              }
              try {
                Thread.sleep(200);
              } catch (InterruptedException e) {
              }
              count++;
            }
{code}

Maybe we can make {{count}} a little larger, and fail the test if the exception 
is not generated after trying {{count}} times.
 
Thanks.


> Add a unit test for HDFS-4660
> -----------------------------
>
>                 Key: HDFS-10652
>                 URL: https://issues.apache.org/jira/browse/HDFS-10652
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode, hdfs
>            Reporter: Yongjun Zhang
>            Assignee: Vinayakumar B
>         Attachments: HDFS-10652.001.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to