Skip to content

Commit 21ef0fd

Browse files
WeichenXu123HyukjinKwon
authored andcommitted
[SPARK-28582][PYSPARK] Fix flaky test DaemonTests.do_termination_test which fail on Python 3.7
Fix flaky test DaemonTests.do_termination_test which fail on Python 3.7. I add a sleep after the test connection to daemon. 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 #25315 from WeichenXu123/fix_py37_daemon. Authored-by: WeichenXu <[email protected]> Signed-off-by: HyukjinKwon <[email protected]> (cherry picked from commit fbeee0c) Signed-off-by: HyukjinKwon <[email protected]>
1 parent 5a1e54d commit 21ef0fd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

python/pyspark/tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,9 +1862,12 @@ def do_termination_test(self, terminator):
18621862
# daemon should accept connections
18631863
self.assertTrue(self.connect(port))
18641864

1865+
# wait worker process spawned from daemon exit.
1866+
time.sleep(1)
1867+
18651868
# request shutdown
18661869
terminator(daemon)
1867-
time.sleep(1)
1870+
daemon.wait(5)
18681871

18691872
# daemon should no longer accept connections
18701873
try:

0 commit comments

Comments
 (0)