Skip to content

Commit

Permalink
Add comment for global variables
Browse files Browse the repository at this point in the history
  • Loading branch information
advancedxy committed Mar 1, 2018
1 parent a3d8ad5 commit 28119e9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class JobCancellationSuite extends SparkFunSuite with Matchers with BeforeAndAft
override def afterEach() {
try {
resetSparkContext()
// Reset semaphores if used by multiple tests.
// Note: if other semaphores are shared by multiple tests, please reset them in this block
JobCancellationSuite.taskStartedSemaphore.drainPermits()
JobCancellationSuite.taskCancelledSemaphore.drainPermits()
JobCancellationSuite.twoJobsSharingStageSemaphore.drainPermits()
JobCancellationSuite.executionOfInterruptibleCounter.set(0)
} finally {
super.afterEach()
}
Expand Down Expand Up @@ -442,6 +442,7 @@ class JobCancellationSuite extends SparkFunSuite with Matchers with BeforeAndAft


object JobCancellationSuite {
// To avoid any headaches, reset these global variables in the companion class's afterEach block
val taskStartedSemaphore = new Semaphore(0)
val taskCancelledSemaphore = new Semaphore(0)
val twoJobsSharingStageSemaphore = new Semaphore(0)
Expand Down

0 comments on commit 28119e9

Please sign in to comment.