Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-7311

Fix non-idempotent test in TestTaskProgressReporter

    XMLWordPrintableJSON

Details

    Description

      The test `org.apache.hadoop.mapred.TestTaskProgressReporter.testBytesWrittenRespectingLimit` is not idempotent and fails if run twice in the same JVM, because it pollutes state shared among tests. It may be good to clean this state pollution so that some other tests do not fail in the future due to the shared state polluted by this test.

      Details

      Running `TestTaskProgressReporter.testBytesWrittenRespectingLimit` twice would result in the second run failing with the following assertion:

      Assert.assertEquals(failFast, threadExited)
      

      The root cause for this is that when`testBytesWrittenRespectingLimit` writes some bytes on the local file system, some counters are being incremented. The problem is that, after the test is done, the counter is not reset. With this polluted shared state, assumptions are broken, resulting in test failure in the second run.

      PR link: https://github.com/apache/hadoop/pull/2500

      Attachments

        1. MAPREDUCE-7311.002.patch
          1 kB
          Zhengxi Li
        2. MAPREDUCE-7311.001.patch
          1 kB
          Zhengxi Li

        Issue Links

          Activity

            People

              lzx404243 Zhengxi Li
              lzx404243 Zhengxi Li
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 1.5h
                  1.5h