Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,26 +308,31 @@ def notebook_resources():


def filter_messages_on_error_output(err_output):
allowed_lines = [
allowed_prefixes = [
# ipykernel might be installed without debugpy extension
"[IPKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled",
"[IPKernelApp] WARNING | debugpy_stream undefined",
# ipykernel warns when kernel runs over TCP without CurveZMQ encryption
"[IPKernelApp] WARNING | Kernel is running over TCP without encryption.",
]
filtered_result = [
line
for line in err_output.splitlines()
if not any(line.startswith(prefix) for prefix in allowed_prefixes)
]
lines = err_output.splitlines()
# Known benign race condition: kernel sends a status message on a socket already
# closed during parallel shutdown. Filter the entire traceback block.
in_zmq_traceback = False
filtered_result = []
for line in lines:
final_filtered_result = []
for line in filtered_result:
if "ERROR:tornado.general:Uncaught exception in ZMQStream callback" in line:
in_zmq_traceback = True
if in_zmq_traceback:
if "zmq.error.ZMQError: Socket operation on non-socket" in line:
in_zmq_traceback = False
continue
if line not in allowed_lines:
filtered_result.append(line)
final_filtered_result.append(line)

return os.linesep.join(filtered_result)
return os.linesep.join(final_filtered_result)


@pytest.mark.parametrize(
Expand Down
Loading