Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/16335#discussion_r92967880
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLogSuite.scala
---
@@ -209,14 +209,21 @@ class HDFSMetadataLogSuite extends SparkFunSuite with
SharedSQLContext {
}
// Open and delete
- val f1 = fm.open(path)
- fm.delete(path)
- assert(!fm.exists(path))
- intercept[IOException] {
- fm.open(path)
+ // Open and delete
+ if (Utils.isWindows) {
+ Utils.tryWithResource(fm.open(path))(_ => ())
+ fm.delete(path)
+ fm.delete(path) // should not throw exception
+ } else {
+ Utils.tryWithResource(fm.open(path)) { _ =>
--- End diff --
We should close when it emits an exception. Otherwise, it is possible to
suppress the actual assertion error due to the exception in removing the path,
that makes the debug harder.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]