File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
core/src/test/scala/org/apache/spark/rdd
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import java.io.File
2222import scala .collection .Map
2323import scala .io .Codec
2424import scala .sys .process ._
25+ import scala .util .Try
2526
2627import org .apache .hadoop .fs .Path
2728import org .apache .hadoop .io .{LongWritable , Text }
@@ -213,7 +214,8 @@ class PipedRDDSuite extends SparkFunSuite with SharedSparkContext {
213214 }
214215
215216 def testCommandAvailable (command : String ): Boolean = {
216- Process (command).run().exitValue() == 0
217+ val attempt = Try (Process (command).run().exitValue())
218+ attempt.isSuccess && attempt.get == 0
217219 }
218220
219221 def testExportInputFile (varName : String ) {
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ package org.apache.spark.sql.hive.execution
2020import java .sql .{Date , Timestamp }
2121
2222import scala .sys .process .Process
23+ import scala .util .Try
2324
2425import org .apache .hadoop .fs .Path
2526
@@ -1773,6 +1774,7 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
17731774 }
17741775
17751776 def testCommandAvailable (command : String ): Boolean = {
1776- Process (command).run().exitValue() == 0
1777+ val attempt = Try (Process (command).run().exitValue())
1778+ attempt.isSuccess && attempt.get == 0
17771779 }
17781780}
You can’t perform that action at this time.
0 commit comments