Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import scala.language.existentials
import com.github.fommil.netlib.BLAS.{getInstance => blas}
import org.apache.commons.io.FileUtils
import org.apache.commons.io.filefilter.TrueFileFilter
import org.scalatest.BeforeAndAfterEach

import org.apache.spark._
import org.apache.spark.internal.Logging
Expand Down Expand Up @@ -777,7 +778,20 @@ class ALSSuite
}
}

class ALSCleanerSuite extends SparkFunSuite {
class ALSCleanerSuite extends SparkFunSuite with BeforeAndAfterEach {
override def beforeEach(): Unit = {
super.beforeEach()
// Once `Utils.getOrCreateLocalRootDirs` is called, it is cached in `Utils.localRootDirs`.
// Unless this is manually cleared before and after a test, it returns the same directory
// set before even if 'spark.local.dir' is configured afterwards.
Utils.clearLocalRootDirs()
}

override def afterEach(): Unit = {
Utils.clearLocalRootDirs()
super.afterEach()
}

test("ALS shuffle cleanup standalone") {
val conf = new SparkConf()
val localDir = Utils.createTempDir()
Expand Down