You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
some IMDReader streaming tests time out with imdclient 0.2.4 #5442
I can confirm that locally the imd tests pass with imdclient 0.2.3 and also pass with 0.2.4 ( pytest -v test_imd.py) (on Python 3.14, macOS, develop MDA 3d3a53e) BUT they take a LONG time
It looks as if these 0.2.3 tests take about 5 seconds to pass. This is suspicious because the imdclient default timeout for 0.2.3 is 5s and the same tests now take a long time (after the imdclient timeout was increased to 600s).
@amruthesht how do I enforce a short timeout for the tests? This is important and urgent to just get the CI working again.
We then need to understand why we need timeout for tests to pass — what kind of behavior in imdclient has IMDReader relying out for properly ending reading??
@orbeckst I think the problem is that we never call disconnect or close on the dummy IMDServer's socket until after the test ends, during cleanup- so the only way the reader has of knowing the stream has ended during the test is via the timeout.
So we need two changes: IMDServer needs to call socket.shutdown(socket.SHUTDOWN_WR) as a part of its disconnect() call, and the reader fixtures in these tests need to call server.disconnect() after sending frames through the socket
mda side - can be merged WITHOUT above MR, since disconnect already calls socket.close() which will send EOF in the case of only one process holding the file descriptor to the senders socket, as is always currently true in our tests) #5443
Thanks for quickly digging into this issue. I’m also reviewing the PR on the imdclient side. I might not fully understand how the server is supposed to work so please bear with my questions.
Activity
orbeckst commentedon Jul 19, 2026
@amruthesht @ljwoods2 do you have an idea of what may lead to these failures?
orbeckst commentedon Jul 19, 2026
I can confirm that locally the imd tests pass with imdclient 0.2.3 and also pass with 0.2.4 (
pytest -v test_imd.py) (on Python 3.14, macOS, develop MDA 3d3a53e) BUT they take a LONG timeIt looks as if these 0.2.3 tests take about 5 seconds to pass. This is suspicious because the imdclient default timeout for 0.2.3 is 5s and the same tests now take a long time (after the imdclient timeout was increased to 600s).
I tried adding
timeout=10tomdanalysis/testsuite/MDAnalysisTests/coordinates/test_imd.py
Line 213 in 3d3a53e
orbeckst commentedon Jul 19, 2026
Confirmed that with imdclient 0.2.4 one of the tests in question passes after the 600-s timeout value (=10 min):
orbeckst commentedon Jul 19, 2026
@amruthesht how do I enforce a short timeout for the tests? This is important and urgent to just get the CI working again.
We then need to understand why we need
timeoutfor tests to pass — what kind of behavior in imdclient has IMDReader relying out for properly ending reading??ljwoods2 commentedon Jul 19, 2026
@orbeckst I think the problem is that we never call disconnect or close on the dummy IMDServer's socket until after the test ends, during cleanup- so the only way the reader has of knowing the stream has ended during the test is via the timeout.
mdanalysis/testsuite/MDAnalysisTests/coordinates/test_imd.py
Line 438 in 3d3a53e
So we need two changes: IMDServer needs to call
socket.shutdown(socket.SHUTDOWN_WR)as a part of itsdisconnect()call, and thereaderfixtures in these tests need to callserver.disconnect()after sending frames through the socketljwoods2 commentedon Jul 19, 2026
@orbeckst
imdclient repo side
Becksteinlab/imdclient#149
mda side - can be merged WITHOUT above MR, since
disconnectalready callssocket.close()which will send EOF in the case of only one process holding the file descriptor to the senders socket, as is always currently true in our tests)#5443
orbeckst commentedon Jul 20, 2026
Thanks for quickly digging into this issue. I’m also reviewing the PR on the imdclient side. I might not fully understand how the server is supposed to work so please bear with my questions.
Ensure IMDServer sends EOF to client DURING test (#5443)
amruthesht commentedon Jul 20, 2026
My apologies; I just saw this. Thank you @ljwoods2 for getting to this!