Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ulysses-you committed Mar 1, 2021
1 parent 4eb62de commit d2a001a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ import org.apache.kyuubi.Utils
import org.apache.kyuubi.config.KyuubiConf._
import org.apache.kyuubi.engine.spark.{SparkSQLEngine, WithSparkSQLEngine}
import org.apache.kyuubi.operation.JDBCTestUtils
import org.apache.kyuubi.service.ServiceState._

class SessionSuite extends WithSparkSQLEngine with JDBCTestUtils {
override def beforeAll(): Unit = {
System.setProperty(ENGINE_SHARED_LEVEL.key, "CONNECTION")
}

override def afterAll(): Unit = {
Expand All @@ -42,7 +44,6 @@ class SessionSuite extends WithSparkSQLEngine with JDBCTestUtils {
s"jdbc:derby:;databaseName=$metastorePath;create=true")
System.setProperty("spark.sql.warehouse.dir", warehousePath.toString)
System.setProperty("spark.sql.hive.metastore.sharedPrefixes", "org.apache.hive.jdbc")
System.setProperty(ENGINE_SHARED_LEVEL.key, "CONNECTION")
spark = SparkSQLEngine.createSpark()
engine = SparkSQLEngine.startEngine(spark)
}
Expand All @@ -62,10 +63,10 @@ class SessionSuite extends WithSparkSQLEngine with JDBCTestUtils {
override protected def jdbcUrl: String = s"jdbc:hive2://${engine.connectionUrl}/;"

test("release session if shared level is CONNECTION") {
assert(engine.started.get)
assert(engine.getServiceState == STARTED)
withJdbcStatement() {_ => }
eventually(Timeout(60.seconds)) {
assert(!engine.started.get)
eventually(Timeout(200.seconds)) {
assert(engine.getServiceState == STARTED)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.apache.kyuubi.config.KyuubiConf
abstract class Serverable(name: String) extends CompositeService(name) {

private val OOMHook = new Runnable { override def run(): Unit = stop() }
private[kyuubi] val started = new AtomicBoolean(false)
private val started = new AtomicBoolean(false)

private[kyuubi] val backendService: AbstractBackendService
private lazy val frontendService = new FrontendService(backendService, OOMHook)
Expand Down

0 comments on commit d2a001a

Please # to comment.