Skip to content

Commit 20d6af5

Browse files
committed
test: reproducer for pyzmq Context.__del__ ioloop wedge
Add tests/pytests/functional/transport/zeromq/test_context_finalizer_wedge.py documenting the pyzmq >= 24 Context.__del__ -> destroy() -> socket.close() behavior that freezes a salt-minion's asyncio ioloop when a leaked zmq.Context with a queued undeliverable send is finalized inside a callback. Four tests: - test_pyzmq_context_del_hangs_baseline (xfail(strict=True)): bare pyzmq primitive wedges > 4s on shipped pyzmq 27.1.0. - test_ioloop_freezes_when_leaked_context_finalized_in_callback (xfail(strict=True)): production failure shape -- leaked Context finalized inside asyncio callback freezes the loop; canary tick counter measures the freeze. - test_explicit_destroy_linger_zero_prevents_ioloop_freeze: documents the fix pattern (ctx.destroy(linger=0) before drop). - test_salt_zeromq_transport_defines_no_dunder_del: static regression guard that no __del__ is (re)introduced on salt.transport.zeromq classes. The wedge test bodies run under a daemon-thread bound so a wedged zmq_ctx_term() cannot hang the test suite; pytest still reports XFAIL/PASS cleanly. Verified on salt onedir (pyzmq 27.1.0, python 3.14.6): 2 passed, 2 xfailed, 100 warnings in 16.05s
1 parent 191a6df commit 20d6af5

1 file changed

Lines changed: 436 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)