This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new a56b351  [SPARK-26945][PYTHON][SS][TESTS] Fix flaky 
test_*_await_termination in PySpark SS tests
a56b351 is described below

commit a56b3511fc229f42fb385419bc18a90f0d1cd635
Author: Hyukjin Kwon <gurwls...@apache.org>
AuthorDate: Sat Feb 23 14:57:04 2019 +0800

    [SPARK-26945][PYTHON][SS][TESTS] Fix flaky test_*_await_termination in 
PySpark SS tests
    
    ## What changes were proposed in this pull request?
    
    This PR proposes to make sure processing all available data before stopping 
and delete the temp directory.
    
    See 
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/102518/console
    
    ```
    ERROR: test_query_manager_await_termination 
(pyspark.sql.tests.test_streaming.StreamingTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
     File 
"/home/jenkins/workspace/SparkPullRequestBuilder/python/pyspark/sql/tests/test_streaming.py",
 line 259, in test_query_manager_await_termination
     shutil.rmtree(tmpPath)
     File "/home/anaconda/lib/python2.7/shutil.py", line 256, in rmtree
     onerror(os.rmdir, path, sys.exc_info())
     File "/home/anaconda/lib/python2.7/shutil.py", line 254, in rmtree
     os.rmdir(path)
    OSError: [Errno 39] Directory not empty: 
'/home/jenkins/workspace/SparkPullRequestBuilder/python/target/072153bd-f981-47be-bda2-e2b657a16f65/tmp4WGp7n'
    ```
    
    See 
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/102311/console
    
    ```
    ERROR: test_stream_await_termination 
(pyspark.sql.tests.test_streaming.StreamingTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File 
"/home/jenkins/workspace/SparkPullRequestBuilder2/python/pyspark/sql/tests/test_streaming.py",
 line 202, in test_stream_await_termination
        shutil.rmtree(tmpPath)
      File "/usr/lib64/pypy-2.5.1/lib-python/2.7/shutil.py", line 256, in rmtree
        onerror(os.rmdir, path, sys.exc_info())
      File "/usr/lib64/pypy-2.5.1/lib-python/2.7/shutil.py", line 254, in rmtree
        os.rmdir(path)
    OSError: [Errno 39] Directory not empty: 
'/home/jenkins/workspace/SparkPullRequestBuilder2/python/target/7244f4ff-6b60-4f6c-b787-de4f15922bf5/tmpQbMZSo'
    ```
    
    ## How was this patch tested?
    
    Jenkins tests - I should run multiple times to see if there are other flaky 
tests + if this PR really fixes it.
    
    Closes #23870 from HyukjinKwon/SPARK-26945.
    
    Authored-by: Hyukjin Kwon <gurwls...@apache.org>
    Signed-off-by: Hyukjin Kwon <gurwls...@apache.org>
---
 python/pyspark/sql/tests/test_streaming.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/python/pyspark/sql/tests/test_streaming.py 
b/python/pyspark/sql/tests/test_streaming.py
index 4b71759..ac4b691 100644
--- a/python/pyspark/sql/tests/test_streaming.py
+++ b/python/pyspark/sql/tests/test_streaming.py
@@ -198,6 +198,7 @@ class StreamingTests(ReusedSQLTestCase):
             self.assertTrue(duration >= 2)
             self.assertFalse(res)
         finally:
+            q.processAllAvailable()
             q.stop()
             shutil.rmtree(tmpPath)
 
@@ -255,6 +256,7 @@ class StreamingTests(ReusedSQLTestCase):
             self.assertTrue(duration >= 2)
             self.assertFalse(res)
         finally:
+            q.processAllAvailable()
             q.stop()
             shutil.rmtree(tmpPath)
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to