Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-4893

Clean up uses of System.setProperty in unit tests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • Spark Core
    • None

    Description

      Several of our tests call System.setProperty (or test code which implicitly sets system properties) and don't always reset/clear the modified properties, which can create ordering dependencies between tests and cause hard-to-diagnose failures.

      I think we can remove most of these System.setProperty calls and replace them by proper usage of SparkConf.

      For the remaining cases where we still need to use System.setProperty, I think that we should use a ScalaTest fixture / mixin to automatically snapshot and restore system properties after test runs.

      Attachments

        Issue Links

          Activity

            People

              joshrosen Josh Rosen
              joshrosen Josh Rosen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: