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

TestBlockScanner does not close TestContext properly

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.10.0, 3.2.0, 3.1.1, 2.9.2, 3.0.3
    • None
    • Reviewed

    Description

      Without closing ctx in testMarkSuspectBlock, testIgnoreMisplacedBlock, testAppendWhileScanning, some tests fail on Windows:

      [INFO] Running org.apache.hadoop.hdfs.server.datanode.TestBlockScanner
      [ERROR] Tests run: 14, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 113.398 s <<< FAILURE! - in org.apache.hadoop.hdfs.server.datanode.TestBlockScanner
      [ERROR] testScanAllBlocksWithRescan(org.apache.hadoop.hdfs.server.datanode.TestBlockScanner) Time elapsed: 0.031 s <<< ERROR!
      java.io.IOException: Could not fully delete E:\OSS\hadoop-branch-2\hadoop-hdfs-project\hadoop-hdfs\target\test\data\dfs\name1
      at org.apache.hadoop.hdfs.MiniDFSCluster.createNameNodesAndSetConf(MiniDFSCluster.java:1047)
      at org.apache.hadoop.hdfs.MiniDFSCluster.initMiniDFSCluster(MiniDFSCluster.java:883)
      at org.apache.hadoop.hdfs.MiniDFSCluster.<init>(MiniDFSCluster.java:514)
      at org.apache.hadoop.hdfs.MiniDFSCluster$Builder.build(MiniDFSCluster.java:473)
      at org.apache.hadoop.hdfs.server.datanode.TestBlockScanner$TestContext.<init>(TestBlockScanner.java:102)
      at org.apache.hadoop.hdfs.server.datanode.TestBlockScanner.testScanAllBlocksImpl(TestBlockScanner.java:366)
      at org.apache.hadoop.hdfs.server.datanode.TestBlockScanner.testScanAllBlocksWithRescan(TestBlockScanner.java:435)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)

      ...

      [INFO]
      [INFO] Results:
      [INFO]
      [ERROR] Errors:
      [ERROR] TestBlockScanner.testAppendWhileScanning:899 ╗ IO Could not fully delete E:\OS...
      [ERROR] TestBlockScanner.testCorruptBlockHandling:488 ╗ IO Could not fully delete E:\O...
      [ERROR] TestBlockScanner.testDatanodeCursor:531 ╗ IO Could not fully delete E:\OSS\had...
      [ERROR] TestBlockScanner.testMarkSuspectBlock:717 ╗ IO Could not fully delete E:\OSS\h...
      [ERROR] TestBlockScanner.testScanAllBlocksWithRescan:435->testScanAllBlocksImpl:366 ╗ IO
      [ERROR] TestBlockScanner.testScanRateLimit:450 ╗ IO Could not fully delete E:\OSS\hado...
      [ERROR] TestBlockScanner.testVolumeIteratorWithCaching:261->testVolumeIteratorImpl:169 ╗ IO
      [ERROR] TestBlockScanner.testVolumeIteratorWithoutCaching:256->testVolumeIteratorImpl:169 ╗ IO
      [INFO]
      [ERROR] Tests run: 14, Failures: 0, Errors: 8, Skipped: 0

      Attachments

        1. HDFS-13559.001.patch
          1 kB
          Anbang Hu
        2. HDFS-13559.000.patch
          1 kB
          Anbang Hu

        Issue Links

          Activity

            People

              huanbang1993 Anbang Hu
              huanbang1993 Anbang Hu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: