[SPARK-28582][PYTHON] Fix flaky test DaemonTests.do_termination_test which fail on Python 3.7
## What changes were proposed in this pull request? This PR picks up https://github.com/apache/spark/pull/25315 back after removing `Popen.wait` usage which exists in Python 3 only. I saw the last test results wrongly and thought it was passed. Fix flaky test DaemonTests.do_termination_test which fail on Python 3.7. I add a sleep after the test connection to daemon. ## How was this patch tested? Run test ``` python/run-tests --python-executables=python3.7 --testname "pyspark.tests.test_daemon DaemonTests" ``` **Before** Fail on test "test_termination_sigterm". And we can see daemon process do not exit. **After** Test passed Closes #25343 from HyukjinKwon/SPARK-28582. Authored-by: WeichenXu <weichen.xu@databricks.com> Signed-off-by: HyukjinKwon <gurwls223@apache.org>
This commit is contained in:
parent
0c6874fb37
commit
b3394db193
|
@ -47,6 +47,9 @@ class DaemonTests(unittest.TestCase):
|
||||||
# daemon should accept connections
|
# daemon should accept connections
|
||||||
self.assertTrue(self.connect(port))
|
self.assertTrue(self.connect(port))
|
||||||
|
|
||||||
|
# wait worker process spawned from daemon exit.
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
# request shutdown
|
# request shutdown
|
||||||
terminator(daemon)
|
terminator(daemon)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
Loading…
Reference in a new issue