Skip to content

Commit 3ed2945

Browse files
committed
CI windows.
1 parent 089a503 commit 3ed2945

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

pymodbus/transport/transport.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ async def transport_connect(self) -> bool:
255255
Log.warning("Failed to connect {}", exc)
256256
self.transport_close(intern=True, reconnect=True)
257257
return False
258+
except Exception as exc:
259+
Log.warning("Failed to connect UNKNOWN EXCEPTION {}", exc)
260+
raise
258261
return bool(self.transport)
259262

260263
async def transport_listen(self) -> bool:

test/conftest.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,22 @@ async def _check_system_health():
4949
start_tasks = {task.get_name(): task for task in asyncio.all_tasks()}
5050
yield
5151
await asyncio.sleep(0.1)
52-
end_clean = []
52+
all_clean = True
53+
error_text = "ERROR tasks/threads hanging:\n"
5354
for thread in thread_enumerate():
5455
name = thread.getName()
55-
if (
56+
if not (
5657
(name in start_threads)
5758
or (name == "asyncio_0")
5859
or (sys.version_info.minor == 8 and name.startswith("ThreadPoolExecutor"))
5960
):
60-
continue
61-
end_clean.append(("THREAD", thread))
61+
error_text += f"-->THREAD: {thread}\n"
62+
all_clean = False
6263
for task in asyncio.all_tasks():
63-
if task.get_name() not in start_tasks and "wrap_asyncgen_fixture" not in str(
64-
task
65-
):
66-
end_clean.append(("TASK", task))
67-
if end_clean:
68-
error_text = "ERROR tasks/threads hanging:\n"
69-
for entry in end_clean:
70-
error_text += f"-->{entry[0]}: {entry[1]}\n"
71-
raise AssertionError(error_text)
64+
if not (task.get_name() in start_tasks or "wrap_asyncgen_fixture" in str(task)):
65+
error_text += f"-->TASK: {task}\n"
66+
all_clean = False
67+
assert all_clean, error_text
7268
assert not NullModem.is_dirty()
7369

7470

0 commit comments

Comments
 (0)