Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-4055

TestAuditLogs is flaky

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.3-alpha
    • None
    • None
    • Reviewed

    Description

          InputStream istream = webfs.open(file);
          int val = istream.read();
          istream.close();
      
          verifyAuditLogsRepeat(true, 3);
          assertTrue("failed to read from file", val >= 0);
      
          byte[] toWrite = new byte[bufferLen];
          Random rb = new Random(seed);
          long bytesToWrite = fileLen;
          while (bytesToWrite>0) {
            rb.nextBytes(toWrite);
      

      InputStream.read() return the first byte of the file, the bytes in the file is generated in using Random.nextBytes(), so you get 1/256 chance the first byte is 0, so some times it may fail.

      Attachments

        Issue Links

          Activity

            People

              decster Binglin Chang
              decster Binglin Chang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: