@@ -23,7 +23,6 @@ import java.sql.{DriverManager, Statement}
2323import java .util .concurrent .TimeoutException
2424
2525import scala .collection .mutable .ArrayBuffer
26- import scala .collection .JavaConversions ._
2726import scala .concurrent .duration ._
2827import scala .concurrent .{Await , Promise }
2928import scala .sys .process .{Process , ProcessLogger }
@@ -43,11 +42,6 @@ class HiveThriftServer2Suite extends FunSuite with Logging {
4342 Class .forName(classOf [HiveDriver ].getCanonicalName)
4443
4544 val verbose = Option (System .getenv(" SPARK_SQL_TEST_VERBOSE" )).isDefined
46- // Since we use info to assert server process started successfully,
47- // make sure that log4j level is INFO
48- org.apache.log4j.LogManager .getCurrentLoggers.foreach { log =>
49- log.asInstanceOf [org.apache.log4j.Logger ].setLevel(org.apache.log4j.Level .INFO )
50- }
5145
5246 def startThriftServerWithin (timeout : FiniteDuration = 1 .minute)(f : Statement => Unit ) {
5347 Thread .sleep(5000 )
@@ -100,8 +94,8 @@ class HiveThriftServer2Suite extends FunSuite with Logging {
10094 .run(ProcessLogger (captureLogOutput, _ => ()))
10195 }
10296 }
103-
104- Process (command).run(ProcessLogger (
97+ // reset SPARK_TESTING to avoid loading Log4J configurations in testing class paths
98+ Process (command, None , ( " SPARK_TESTING " , " 0 " ) ).run(ProcessLogger (
10599 captureThriftServerOutput(" stdout" ),
106100 captureThriftServerOutput(" stderr" )))
107101
0 commit comments