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

Fix Flakes Junit Tests that often report timeouts

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • test
    • Reviewed

    Description

      When I was dealing with HDFS-16590 JIRA, Junit Tests often reported errors, I found that one type of problem is TimeOut problem, these problems can be avoided by adjusting TimeOut time.

      The modified method is as follows:

      1.org.apache.hadoop.hdfs.TestFileCreation#testServerDefaultsWithMinimalCaching

      [ERROR] testServerDefaultsWithMinimalCaching(org.apache.hadoop.hdfs.TestFileCreation)  Time elapsed: 7.136 s  <<< ERROR!
      java.util.concurrent.TimeoutException: 
      Timed out waiting for condition. 
      Thread diagnostics: 
      
      [WARNING] org.apache.hadoop.hdfs.TestFileCreation.testServerDefaultsWithMinimalCaching(org.apache.hadoop.hdfs.TestFileCreation)
      [ERROR]   Run 1: TestFileCreation.testServerDefaultsWithMinimalCaching:277 Timeout Timed out ...
      [INFO]   Run 2: PASS

      2.org.apache.hadoop.hdfs.TestDFSShell#testFilePermissions

      [ERROR] testFilePermissions(org.apache.hadoop.hdfs.TestDFSShell)  Time elapsed: 30.022 s  <<< ERROR!
      org.junit.runners.model.TestTimedOutException: test timed out after 30000 milliseconds
      	at java.lang.Thread.dumpThreads(Native Method)
      	at java.lang.Thread.getStackTrace(Thread.java:1549)
      	at org.junit.internal.runners.statements.FailOnTimeout.createTimeoutException(FailOnTimeout.java:182)
      	at org.junit.internal.runners.statements.FailOnTimeout.getResult(FailOnTimeout.java:177)
      	at org.junit.internal.runners.statements.FailOnTimeout.evaluate(FailOnTimeout.java:128)
      	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299)
      	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.lang.Thread.run(Thread.java:748)
      
      [WARNING] org.apache.hadoop.hdfs.TestDFSShell.testFilePermissions(org.apache.hadoop.hdfs.TestDFSShell)
      [ERROR]   Run 1: TestDFSShell.testFilePermissions TestTimedOut test timed out after 30000 mil...
      [INFO]   Run 2: PASS 

      3.org.apache.hadoop.hdfs.server.sps.TestExternalStoragePolicySatisfier#testSPSWhenFileHasExcessRedundancyBlocks

      [ERROR] testSPSWhenFileHasExcessRedundancyBlocks(org.apache.hadoop.hdfs.server.sps.TestExternalStoragePolicySatisfier)  Time elapsed: 67.904 s  <<< ERROR!
      java.util.concurrent.TimeoutException: 
      Timed out waiting for condition. 
      
      [WARNING] org.apache.hadoop.hdfs.server.sps.TestExternalStoragePolicySatisfier.testSPSWhenFileHasExcessRedundancyBlocks(org.apache.hadoop.hdfs.server.sps.TestExternalStoragePolicySatisfier)
      [ERROR]   Run 1: TestExternalStoragePolicySatisfier.testSPSWhenFileHasExcessRedundancyBlocks:1379 Timeout
      [ERROR]   Run 2: TestExternalStoragePolicySatisfier.testSPSWhenFileHasExcessRedundancyBlocks:1379 Timeout
      [INFO]   Run 3: PASS 

      Attachments

        Issue Links

          Activity

            People

              slfan1989 Shilun Fan
              slfan1989 Shilun Fan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h