[SPARK-33191][YARN][TESTS] Fix PySpark test cases in YarnClusterSuite#30099
[SPARK-33191][YARN][TESTS] Fix PySpark test cases in YarnClusterSuite#30099HyukjinKwon wants to merge 1 commit intoapache:masterfrom
Conversation
6fad8eb to
ee96293
Compare
This comment has been minimized.
This comment has been minimized.
ee96293 to
ccabb04
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Okay, it passes in Jenkins: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Test build #130040 has finished for PR 30099 at commit
|
| private val pythonExecutablePath = { | ||
| // To make sure to use the same Python executable. | ||
| val maybePath = TestUtils.getAbsolutePathFromExecutable("python3") | ||
| assert(maybePath.isDefined) |
There was a problem hiding this comment.
maybe we should have a more descriptive error message if this fails so users can easily figure out what's wrong.
It also seems like we should have a better way to specify the python executable then hardcoding to python3 in this test, but that isn't something you changed.
There was a problem hiding this comment.
If we don't have python3, it will not even start to run the tests ... e.g.) see https://github.com/apache/spark/blob/master/dev/run-tests.py#L1 This is rather just a sanity check. But sure, I can add some more messages, though.
|
this doesn't guarantee they use the same python version still - at least not minor version (3.5 vs 3.4) if executor node has different version then the driver node, but you think its a python2 vs python3, correct? |
|
@tgravescs, but the tests run in the same node. If we specify the absolute path, it will point out the same Python version. This is a test only fix BTW. |
|
Thanks, Tom. Let me merge this into master :-). |
|
Merged to master. |
|
Thank you for the fix, @HyukjinKwon ! |
|
nice! thanks for the fix @HyukjinKwon ! |
What changes were proposed in this pull request?
This PR proposes to fix:
it currently fails as below:
I think this was broken when Python 2 was dropped but was not caught because this specific test does not run when there's no change in YARN codes. See also #29843 (comment)
The root cause seems like the paths are different, see #29843 (review). I think Jenkins uses a different Python executable via Anaconda and the executor side does not know where it is for some reasons.
This PR proposes to fix it just by explicitly specifying the absolute path for Python executable so the tests should pass in any environment.
Why are the changes needed?
To make tests pass.
Does this PR introduce any user-facing change?
No, dev-only.
How was this patch tested?
This issue looks specific to Jenkins. It should run the tests on Jenkins.