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 @@ -20,13 +20,14 @@ import java.io.{PipedInputStream, PipedOutputStream}
import java.util.concurrent.{Executors, Semaphore, TimeUnit}

import org.apache.commons.io.output.ByteArrayOutputStream
import org.scalatest.BeforeAndAfterEach

import org.apache.spark.sql.connect.client.util.RemoteSparkSession

class ReplE2ESuite extends RemoteSparkSession {
class ReplE2ESuite extends RemoteSparkSession with BeforeAndAfterEach {

private val executorService = Executors.newSingleThreadExecutor()
private val TIMEOUT_SECONDS = 10
private val TIMEOUT_SECONDS = 30

private var testSuiteOut: PipedOutputStream = _
private var ammoniteOut: ByteArrayOutputStream = _
Expand Down Expand Up @@ -68,6 +69,10 @@ class ReplE2ESuite extends RemoteSparkSession {
super.afterAll()
}

override def afterEach(): Unit = {
semaphore.drainPermits()
}

def runCommandsInShell(input: String): String = {
require(input.nonEmpty)
// Pad the input with a semaphore release so that we know when the execution of the provided
Expand Down