File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
core/src/test/scala/org/apache/spark/util Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package org.apache.spark.util
1919
2020import java .util .Properties
2121
22+ import org .apache .commons .lang3 .SerializationUtils
2223import org .scalatest .{BeforeAndAfterEach , Suite }
2324
2425/**
@@ -42,7 +43,11 @@ private[spark] trait ResetSystemProperties extends BeforeAndAfterEach { this: Su
4243 var oldProperties : Properties = null
4344
4445 override def beforeEach (): Unit = {
45- oldProperties = new Properties (System .getProperties)
46+ // we need SerializationUtils.clone instead of `new Properties(System.getProperties()` because
47+ // the later way of creating a copy does not copy the properties but it initializes a new
48+ // Properties object with the given properties as defaults. They are not recognized at all
49+ // by standard Scala wrapper over Java Properties then.
50+ oldProperties = SerializationUtils .clone(System .getProperties)
4651 super .beforeEach()
4752 }
4853
You can’t perform that action at this time.
0 commit comments