Skip to content

Commit

Permalink
Fix failure to generate worker_id when xdist is not present (#4799)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Lowe <jlowe@nvidia.com>
  • Loading branch information
jlowe authored Feb 16, 2022
1 parent 0011ac6 commit bdb6e72
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion integration_tests/src/main/python/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,17 @@ def std_input_path(request):
yield path

@pytest.fixture
def spark_tmp_path(request, worker_id):
def spark_tmp_path(request):
debug = request.config.getoption('debug_tmp_path')
ret = request.config.getoption('tmp_path')
if ret is None:
ret = '/tmp/pyspark_tests/'
worker_id = 'main'
try:
import xdist
worker_id = xdist.plugin.get_xdist_worker_id(request)
except ImportError:
pass
pid = os.getpid()
hostname = os.uname()[1]
ret = f'{ret}/{hostname}-{worker_id}-{pid}-{random.randrange(0, 1<<31)}/'
Expand Down

0 comments on commit bdb6e72

Please sign in to comment.