attilapiros commented on a change in pull request #24079: 
[SPARK-27145][Minor]Close store  in the SQLAppStatusListenerSuite after test
URL: https://github.com/apache/spark/pull/24079#discussion_r265523069
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala
 ##########
 @@ -43,13 +44,25 @@ import org.apache.spark.util.{AccumulatorMetadata, 
JsonProtocol, LongAccumulator
 import org.apache.spark.util.kvstore.InMemoryStore
 
 
-class SQLAppStatusListenerSuite extends SparkFunSuite with SharedSQLContext 
with JsonTestUtils {
+class SQLAppStatusListenerSuite extends SparkFunSuite with SharedSQLContext 
with JsonTestUtils
+  with BeforeAndAfter {
+
   import testImplicits._
 
   override protected def sparkConf = {
     super.sparkConf.set(LIVE_ENTITY_UPDATE_PERIOD, 
0L).set(ASYNC_TRACKING_ENABLED, false)
   }
 
+  private var kvstore: ElementTrackingStore = _
+
+  before {
+    kvstore = new ElementTrackingStore(new InMemoryStore, sparkContext.conf)
 
 Review comment:
   @shahidki31 the above comment meant to ask you for setting the `kvstore` 
member val only in those tests where the store is really needed and then the 
null checks are needed to know when to close and release it.  

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to