Skip to content

Commit de3f87f

Browse files
committed
[SPARK-18030][TESTS] Fix flaky FileStreamSourceSuite by not deleting the files
## What changes were proposed in this pull request? The test `when schema inference is turned on, should read partition data` should not delete files because the source maybe is listing files. This PR just removes the delete actions since they are not necessary. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes #15699 from zsxwing/SPARK-18030.
1 parent 8bfc3b7 commit de3f87f

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSourceSuite.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ class FileStreamSourceTest extends StreamTest with SharedSQLContext with Private
102102
}
103103
}
104104

105-
case class DeleteFile(file: File) extends ExternalAction {
106-
def runAction(): Unit = {
107-
Utils.deleteRecursively(file)
108-
}
109-
}
110-
111105
/** Use `format` and `path` to create FileStreamSource via DataFrameReader */
112106
def createFileStream(
113107
format: String,
@@ -697,10 +691,6 @@ class FileStreamSourceSuite extends FileStreamSourceTest {
697691
AddTextFileData("{'value': 'keep5'}", partitionBarSubDir, tmp),
698692
CheckAnswer(("keep2", "foo"), ("keep3", "foo"), ("keep4", "bar"), ("keep5", "bar")),
699693

700-
// Delete the two partition dirs
701-
DeleteFile(partitionFooSubDir),
702-
DeleteFile(partitionBarSubDir),
703-
704694
AddTextFileData("{'value': 'keep6'}", partitionBarSubDir, tmp),
705695
CheckAnswer(("keep2", "foo"), ("keep3", "foo"), ("keep4", "bar"), ("keep5", "bar"),
706696
("keep6", "bar"))

0 commit comments

Comments
 (0)