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

Clean shared state pollution to avoid flaky tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • test

    Description

      What is the purpose of this change

      This PR is to clean shared state pollution between tests:

      Test1: org.apache.hadoop.mapreduce.v2.app.TestJobEndNotifier.testNotificationOnLastRetryShutdownWithRuntimeException
      Test2: org.apache.hadoop.mapreduce.v2.app.TestMRAppMaster.testMRAppMasterShutDownJob

      Test1 can pollute the shared state with Test2, which can lead Test2 to fail after running Test1. It may be better to clean state pollutions so that some other tests won't fail in the future due to the shared state polluted by this test.

      Reproduce test failure

      First run Test1, then run Test2 in the same JVM

      Expected result

      The tests should run successfully when multiple tests that use this state are run in the same JVM.

      Actual result

      Run Test1 and Test2, Test2 fails:

      [ERROR] TestMRAppMaster.testMRAppMasterShutDownJob:530 Expected shutDownJob to exit with status code of 0. expected:<0> but was:<1>

      Fix

      Reset FirstExitException at the start of Test2 to clean the pollution from Test1.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              LALAYANG Yang Chen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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