Skip to content

Commit

Permalink
Fix and reenable keyboard interrupt test
Browse files Browse the repository at this point in the history
  • Loading branch information
pentschev committed Oct 3, 2024
1 parent 88168ca commit c59440f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ci/test_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ run_distributed_ucxx_tests() {
ENABLE_DELAYED_SUBMISSION=$2
ENABLE_PYTHON_FUTURE=$3

CMD_LINE="UCXPY_PROGRESS_MODE=${PROGRESS_MODE} UCXPY_ENABLE_DELAYED_SUBMISSION=${ENABLE_DELAYED_SUBMISSION} UCXPY_ENABLE_PYTHON_FUTURE=${ENABLE_PYTHON_FUTURE} timeout 10m python -m pytest -vs python/distributed-ucxx/distributed_ucxx/tests/ -k 'test_nanny_closed_by_keyboard_interrupt'"
CMD_LINE="UCXPY_PROGRESS_MODE=${PROGRESS_MODE} UCXPY_ENABLE_DELAYED_SUBMISSION=${ENABLE_DELAYED_SUBMISSION} UCXPY_ENABLE_PYTHON_FUTURE=${ENABLE_PYTHON_FUTURE} timeout 10m python -m pytest -vs python/distributed-ucxx/distributed_ucxx/tests/
log_command "${CMD_LINE}"
UCXPY_PROGRESS_MODE=${PROGRESS_MODE} UCXPY_ENABLE_DELAYED_SUBMISSION=${ENABLE_DELAYED_SUBMISSION} UCXPY_ENABLE_PYTHON_FUTURE=${ENABLE_PYTHON_FUTURE} timeout 10m python -m pytest -vs python/distributed-ucxx/distributed_ucxx/tests/ -k 'not test_nanny_closed_by_keyboard_interrupt'
UCXPY_PROGRESS_MODE=${PROGRESS_MODE} UCXPY_ENABLE_DELAYED_SUBMISSION=${ENABLE_DELAYED_SUBMISSION} UCXPY_ENABLE_PYTHON_FUTURE=${ENABLE_PYTHON_FUTURE} timeout 10m python -m pytest -vs python/distributed-ucxx/distributed_ucxx/tests/
}
run_distributed_ucxx_tests_internal() {
Expand All @@ -215,8 +215,8 @@ run_distributed_ucxx_tests_internal() {
ENABLE_DELAYED_SUBMISSION=$2
ENABLE_PYTHON_FUTURE=$3
CMD_LINE="UCXPY_PROGRESS_MODE=${PROGRESS_MODE} UCXPY_ENABLE_DELAYED_SUBMISSION=${ENABLE_DELAYED_SUBMISSION} UCXPY_ENABLE_PYTHON_FUTURE=${ENABLE_PYTHON_FUTURE} timeout 10m python -m pytest -vs python/distributed-ucxx/distributed_ucxx/tests_internal/ -k 'not test_nanny_closed_by_keyboard_interrupt'"
CMD_LINE="UCXPY_PROGRESS_MODE=${PROGRESS_MODE} UCXPY_ENABLE_DELAYED_SUBMISSION=${ENABLE_DELAYED_SUBMISSION} UCXPY_ENABLE_PYTHON_FUTURE=${ENABLE_PYTHON_FUTURE} timeout 10m python -m pytest -vs python/distributed-ucxx/distributed_ucxx/tests_internal/

log_command "${CMD_LINE}"
UCXPY_PROGRESS_MODE=${PROGRESS_MODE} UCXPY_ENABLE_DELAYED_SUBMISSION=${ENABLE_DELAYED_SUBMISSION} UCXPY_ENABLE_PYTHON_FUTURE=${ENABLE_PYTHON_FUTURE} timeout 10m python -m pytest -vs python/distributed-ucxx/distributed_ucxx/tests_internal/ -k 'not test_nanny_closed_by_keyboard_interrupt'
UCXPY_PROGRESS_MODE=${PROGRESS_MODE} UCXPY_ENABLE_DELAYED_SUBMISSION=${ENABLE_DELAYED_SUBMISSION} UCXPY_ENABLE_PYTHON_FUTURE=${ENABLE_PYTHON_FUTURE} timeout 10m python -m pytest -vs python/distributed-ucxx/distributed_ucxx/tests_internal/
}
3 changes: 3 additions & 0 deletions python/distributed-ucxx/distributed_ucxx/ucxx.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,10 +671,13 @@ async def serve_forever(client_ep):
await self.comm_handler(ucx)

init_once()
_register_dask_resource(hash(self))
weakref.finalize(self, _deregister_dask_resource, hash(self))
self.ucxx_server = ucxx.create_listener(serve_forever, port=self._input_port)

def stop(self):
self.ucxx_server = None
_deregister_dask_resource(hash(self))

def get_host_port(self):
# TODO: TCP raises if this hasn't started yet.
Expand Down
4 changes: 2 additions & 2 deletions python/ucxx/ucxx/_lib_async/continuous_ucx_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def __init__(self, worker, event_loop, polling_mode=False):
worker.set_progress_thread_start_callback(_create_context)
worker.start_progress_thread(polling_mode=polling_mode, epoll_timeout=1)

# def __del__(self):
# self.worker.stop_progress_thread()
def __del__(self):
self.worker.stop_progress_thread()


class PollingMode(ProgressTask):
Expand Down

0 comments on commit c59440f

Please sign in to comment.