We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With this test file test_leaky_state.py:
test_leaky_state.py
import spylon.spark.launcher as sparklauncher import os def test_set_spark_property(): c = sparklauncher.SparkConfiguration() c.driver_memory = "4g" def test_spark_driver_memory(): c = sparklauncher.SparkConfiguration() c.conf.spark.driver.memory = "5g" c._set_environment_variables() assert '--driver-memory 5g' in os.environ['PYSPARK_SUBMIT_ARGS']
If I run test_spark_driver_memory by itself, it passes just fine:
$ python run_tests.py tests/test_leaky_state.py -k driver -v ========================================================================================================================================================================= test session starts ========================================================================================================================================================================= platform darwin -- Python 3.5.3, pytest-3.0.7, py-1.4.33, pluggy-0.4.0 rootdir: /Users/edill/dev/maxpoint/github/spylon, inifile: collected 2 items tests/test_leaky_state.py::test_spark_driver_memory PASSED ========================================================================================================================================================================= 1 tests deselected ========================================================================================================================================================================== =============================================================================================================================================================== 1 passed, 1 deselected in 0.29 seconds ================================================================================================================================================================ Name Stmts Miss Cover --------------------------------------------------- spylon/__init__.py 4 0 100% spylon/_version.py 261 143 45% spylon/common.py 62 40 35% spylon/spark/__init__.py 4 0 100% spylon/spark/launcher.py 286 126 56% spylon/spark/progress.py 76 65 14% spylon/spark/yarn_launcher.py 144 119 17% tests/test_leaky_state.py 10 2 80% --------------------------------------------------- TOTAL 847 495 42%
But if I run the two of these together, notably with test_set_spark_priority first, then test_spark_driver_memory fails
test_set_spark_priority
test_spark_driver_memory
$ python run_tests.py tests/test_leaky_state.py -v ========================================================================================================================================================================= test session starts ========================================================================================================================================================================= platform darwin -- Python 3.5.3, pytest-3.0.7, py-1.4.33, pluggy-0.4.0 -- /Users/edill/miniconda/envs/spylon/bin/python cachedir: .cache rootdir: /Users/edill/dev/maxpoint/github/spylon, inifile: collected 2 items tests/test_leaky_state.py::test_set_spark_property PASSED tests/test_leaky_state.py::test_spark_driver_memory FAILED ============================================================================================================================================================================== FAILURES =============================================================================================================================================================================== ______________________________________________________________________________________________________________________________________________________________________ test_spark_driver_memory _______________________________________________________________________________________________________________________________________________________________________ def test_spark_driver_memory(): c = sparklauncher.SparkConfiguration() c.conf.spark.driver.memory = "5g" c._set_environment_variables() > assert '--driver-memory 5g' in os.environ['PYSPARK_SUBMIT_ARGS'] E AssertionError: assert '--driver-memory 5g' in '--driver-memory 4g pyspark-shell' tests/test_leaky_state.py:12: AssertionError ================================================================================================================================================================= 1 failed, 1 passed in 0.34 seconds ================================================================================================================================================================== Name Stmts Miss Cover --------------------------------------------------- spylon/__init__.py 4 0 100% spylon/_version.py 261 143 45% spylon/common.py 62 40 35% spylon/spark/__init__.py 4 0 100% spylon/spark/launcher.py 286 124 57% spylon/spark/progress.py 76 65 14% spylon/spark/yarn_launcher.py 144 119 17% tests/test_leaky_state.py 10 0 100% --------------------------------------------------- TOTAL 847 491 42%
The text was updated successfully, but these errors were encountered:
Ok so this was coming from setting an instance variable as a class attribute in the __init__. This is the fix
__init__
Sorry, something went wrong.
No branches or pull requests
With this test file
test_leaky_state.py
:If I run test_spark_driver_memory by itself, it passes just fine:
But if I run the two of these together, notably with
test_set_spark_priority
first, thentest_spark_driver_memory
failsThe text was updated successfully, but these errors were encountered: