diff --git a/changelog/59183.fixed b/changelog/59183.fixed new file mode 100644 index 00000000000..953c94b2b5d --- /dev/null +++ b/changelog/59183.fixed @@ -0,0 +1 @@ +Fixed saltnado websockets disconnecting immediately diff --git a/salt/netapi/rest_tornado/saltnado.py b/salt/netapi/rest_tornado/saltnado.py index f6d6511f810..cae7b80c235 100644 --- a/salt/netapi/rest_tornado/saltnado.py +++ b/salt/netapi/rest_tornado/saltnado.py @@ -332,13 +332,6 @@ class EventListener: """ Get an event (asynchronous of course) return a future that will get it later """ - # if the request finished, no reason to allow event fetching, since we - # can't send back to the client - if request._finished: - future = Future() - future.set_exception(TimeoutException()) - return future - future = Future() if callback is not None: diff --git a/tests/pytests/functional/netapi/rest_tornado/test_event_listener.py b/tests/pytests/functional/netapi/rest_tornado/test_event_listener.py index 0b1f7b62cdb..c80a6d9a5d6 100644 --- a/tests/pytests/functional/netapi/rest_tornado/test_event_listener.py +++ b/tests/pytests/functional/netapi/rest_tornado/test_event_listener.py @@ -13,7 +13,7 @@ class Request: __slots__ = ("_finished",) def __init__(self): - self._finished = False + self._finished = True @pytest.fixture