Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-5560

Clean up bad exception catching practices in TestYarnClient

    Details

    • Type: Test
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In TestYarnClient, tests commonly wrap methods that throw exceptions in a try catch statement similar to the following:

      try {
          client.submitApplication(context);
      } catch (Exception e) {
          Assert.fail("Exception is not expected.");
      }
      

      This hides useful error messages, and surfaces less helpful ones.

        Attachments

        1. YARN-5560.v3.patch
          14 kB
          Sean Po
        2. YARN-5560.v2.patch
          13 kB
          Sean Po
        3. YARN-5560.v1.patch
          13 kB
          Sean Po

          Activity

            People

            • Assignee:
              seanpo03 Sean Po
              Reporter:
              seanpo03 Sean Po
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: