zsxwing commented on code in PR #36589:
URL: https://github.com/apache/spark/pull/36589#discussion_r877648746


##########
python/pyspark/sql/tests/test_streaming.py:
##########
@@ -592,6 +592,18 @@ def collectBatch(df, id):
             if q:
                 q.stop()
 
+    def test_streaming_foreachBatch_graceful_stop(self):
+        # SPARK-39218: Make foreachBatch streaming query stop gracefully
+        def func(batch_df, _):
+            time.sleep(10)

Review Comment:
   I see. `batch_df.count()` probably will touch some code that can be 
interrupted. Can we use `self.spark._jvm.java.lang.Thread.sleep(10000)` to save 
5 seconds in this test?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to