Skip to content

Commit acb6c4f

Browse files
author
Patrick Woody
committed
remove sync
1 parent 7a8ca43 commit acb6c4f

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

sql/core/src/test/scala/org/apache/spark/sql/test/SharedSparkSession.scala

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ trait SharedSparkSession
8383
* Make sure the [[TestSparkSession]] is initialized before any tests are run.
8484
*/
8585
protected override def beforeAll(): Unit = {
86-
this.synchronized {
87-
initializeSession()
88-
}
86+
initializeSession()
8987

9088
// Ensure we have initialized the context before calling parent code
9189
super.beforeAll()
@@ -99,14 +97,12 @@ trait SharedSparkSession
9997
super.afterAll()
10098
} finally {
10199
try {
102-
this.synchronized {
103-
if (_spark != null) {
104-
try {
105-
_spark.sessionState.catalog.reset()
106-
} finally {
107-
_spark.stop()
108-
_spark = null
109-
}
100+
if (_spark != null) {
101+
try {
102+
_spark.sessionState.catalog.reset()
103+
} finally {
104+
_spark.stop()
105+
_spark = null
110106
}
111107
}
112108
} finally {

0 commit comments

Comments
 (0)