MRUnit
  1. MRUnit
  2. MRUNIT-188

Throw assertion error if drivers are reused

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Labels:
      None

      Description

      We should throw an assertion error if a driver.run method is called more than once. See MRUNIT-187 for more details.

      1. MRUNIT-188_v1.patch
        4 kB
        Terry Koch
      2. MRUNIT-188_v2.patch
        13 kB
        Terry Koch

        Issue Links

          Activity

          Hide
          Terry Koch added a comment - - edited

          Proposed fix:

          1) Added a boolean to TestDriver to track whether a driver has been reused (ie has executed run() more than once).
          2) Added a check and set to preRunChecks() in each of the drivers to either throw an exception if it is being reused or to set the boolean to true for the first run().

          Caveat - this patch still has my Javadoc alteration from JIRA 189 (sorry, my bad, n00b mistake) in MapDriverBase, which also has the preRunChecks() addition - I've since been taught how to avoid this in the future and will back out and redo changes if that's an issue.

          Show
          Terry Koch added a comment - - edited Proposed fix: 1) Added a boolean to TestDriver to track whether a driver has been reused (ie has executed run() more than once). 2) Added a check and set to preRunChecks() in each of the drivers to either throw an exception if it is being reused or to set the boolean to true for the first run(). Caveat - this patch still has my Javadoc alteration from JIRA 189 (sorry, my bad, n00b mistake) in MapDriverBase, which also has the preRunChecks() addition - I've since been taught how to avoid this in the future and will back out and redo changes if that's an issue.
          Hide
          Terry Koch added a comment -

          Added maven test methods to old and new api versions of TestMapDriver, TestMapReduceDriver, and TestReduceDriver.

          Show
          Terry Koch added a comment - Added maven test methods to old and new api versions of TestMapDriver, TestMapReduceDriver, and TestReduceDriver.
          Hide
          Brock Noland added a comment -

          Thank you for the contribution Terry! I have committed this to trunk and trunk-hadoop1!

          Show
          Brock Noland added a comment - Thank you for the contribution Terry! I have committed this to trunk and trunk-hadoop1!
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in mrunit-trunk #1114 (See https://builds.apache.org/job/mrunit-trunk/1114/)
          MRUNIT-188 - Throw assertion error if drivers are reused (Terry Kock via Brock Noland) (brock: rev 8c3ca4869d9e9edb1e624803a5b2f8539f425dab)

          • src/test/java/org/apache/hadoop/mrunit/TestMapDriver.java
          • src/main/java/org/apache/hadoop/mrunit/TestDriver.java
          • src/test/java/org/apache/hadoop/mrunit/mapreduce/TestMapReduceDriver.java
          • src/main/java/org/apache/hadoop/mrunit/ReduceDriverBase.java
          • src/main/java/org/apache/hadoop/mrunit/mapreduce/ReduceDriver.java
          • src/main/java/org/apache/hadoop/mrunit/MapDriverBase.java
          • src/test/java/org/apache/hadoop/mrunit/mapreduce/TestReduceDriver.java
          • src/test/java/org/apache/hadoop/mrunit/TestMapReduceDriver.java
          • src/main/java/org/apache/hadoop/mrunit/PipelineMapReduceDriver.java
          • src/main/java/org/apache/hadoop/mrunit/MapReduceDriverBase.java
          • src/test/java/org/apache/hadoop/mrunit/mapreduce/TestMapDriver.java
          • src/test/java/org/apache/hadoop/mrunit/TestReduceDriver.java
          Show
          Hudson added a comment - SUCCESS: Integrated in mrunit-trunk #1114 (See https://builds.apache.org/job/mrunit-trunk/1114/ ) MRUNIT-188 - Throw assertion error if drivers are reused (Terry Kock via Brock Noland) (brock: rev 8c3ca4869d9e9edb1e624803a5b2f8539f425dab) src/test/java/org/apache/hadoop/mrunit/TestMapDriver.java src/main/java/org/apache/hadoop/mrunit/TestDriver.java src/test/java/org/apache/hadoop/mrunit/mapreduce/TestMapReduceDriver.java src/main/java/org/apache/hadoop/mrunit/ReduceDriverBase.java src/main/java/org/apache/hadoop/mrunit/mapreduce/ReduceDriver.java src/main/java/org/apache/hadoop/mrunit/MapDriverBase.java src/test/java/org/apache/hadoop/mrunit/mapreduce/TestReduceDriver.java src/test/java/org/apache/hadoop/mrunit/TestMapReduceDriver.java src/main/java/org/apache/hadoop/mrunit/PipelineMapReduceDriver.java src/main/java/org/apache/hadoop/mrunit/MapReduceDriverBase.java src/test/java/org/apache/hadoop/mrunit/mapreduce/TestMapDriver.java src/test/java/org/apache/hadoop/mrunit/TestReduceDriver.java

            People

            • Assignee:
              Terry Koch
              Reporter:
              Brock Noland
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development