Skip to content

Commit 6b64d5c

Browse files
committed
Fix test case.
1 parent 6bd85fa commit 6b64d5c

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/MetadataLog.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package org.apache.spark.sql.execution.streaming
2424
* - Allow the user to query the latest batch id.
2525
* - Allow the user to query the metadata object of a specified batch id.
2626
* - Allow the user to query metadata objects in a range of batch ids.
27-
* - Allow the user to remove obsolete metdata
27+
* - Allow the user to remove obsolete metadata
2828
*/
2929
trait MetadataLog[T] {
3030

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter {
125125
)
126126
}
127127

128-
testQuietly("StreamExecution metadata garbarge collection") {
128+
testQuietly("StreamExecution metadata garbage collection") {
129129
val inputData = MemoryStream[Int]
130130
val mapped = inputData.toDS().map(6 / _)
131131

@@ -139,15 +139,13 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter {
139139
CheckAnswer(6, 3, 6, 3, 1, 1),
140140

141141
// Three batches have run, but only one set of metadata should be present
142-
AssertOnQuery(
143-
q => {
144-
val metadataLogDir = new java.io.File(q.offsetLog.metadataPath.toString)
145-
val logFileNames = metadataLogDir.listFiles().toSeq.map(_.getName())
146-
val toTest = logFileNames.filter(! _.endsWith(".crc")) // Workaround for SPARK-17475
147-
toTest.size == 1 && toTest.head == "2"
148-
true
149-
}
150-
)
142+
AssertOnQuery("metadata log should contain only one file") { streamExecution =>
143+
val metadataLogDir = new java.io.File(streamExecution.offsetLog.metadataPath.toString)
144+
val logFileNames = metadataLogDir.listFiles().toSeq.map(_.getName())
145+
val toTest = logFileNames.filter(!_.endsWith(".crc")) // Workaround for SPARK-17475
146+
assert(toTest.size == 1 && toTest.head == "2")
147+
true
148+
}
151149
)
152150
}
153151

0 commit comments

Comments
 (0)