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

TestFsDatasetImpl.testReportBadBlocks brittle

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      jenkins failure as sleep() time not long enough

      Failing for the past 1 build (Since #4 )
      Took 7.4 sec.
      Error Message
      expected:<1> but was:<0>
      Stacktrace
      java.lang.AssertionError: expected:<1> but was:<0>
      	at org.junit.Assert.fail(Assert.java:89)
      	at org.junit.Assert.failNotEquals(Assert.java:835)
      	at org.junit.Assert.assertEquals(Assert.java:647)
      	at org.junit.Assert.assertEquals(Assert.java:633)
      

      assert is after a 3s sleep waiting for reports coming in.

            dataNode.reportBadBlocks(block, dataNode.getFSDataset()
                .getFsVolumeReferences().get(0));
            Thread.sleep(3000);                                           // 3s sleep
            BlockManagerTestUtil.updateState(cluster.getNamesystem()
                .getBlockManager());
            // Verify the bad block has been reported to namenode
            Assert.assertEquals(1, cluster.getNamesystem().getCorruptReplicaBlocks());  // here
      

      LambdaTestUtils.eventually() should be used around this assert, maybe with an even shorter initial delay so on faster systems, test is faster.

      Attachments

        Issue Links

          Activity

            People

              vjasani Viraj Jasani
              stevel@apache.org Steve Loughran
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: