-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests hanging forever #10
Comments
It looks like you're using the paramiko client? If so, then this is actually a paramiko issue. It opens Python threads in the background to do the actual communication with the server. So you need to actually close the client or it might get stuck. |
If this is indeed a paramiko issue I assume this issue can be closed? Note to self: Maybe adding a hint in the readme wouldn't hurt though... |
I am having ths problem, if its a paramiko issue, is there any links ? |
Also encountered this problem, I think sure this is the relevant paramiko issue: paramiko/paramiko#520 (the issue is more widespread than the title). As above, explicitly closing the transport or client fixes it, e.g. from the orignal post adding |
Similar problem here. Has anyone figured out how to gracefully kill the |
Nope, still nothing on my end. Shame, because this library is not that useful withthis bug. |
Yeah, this happened to me too.
Not for me. :\ |
@ulope running the server as a thread is probably a mistake. I was able to work around this issue by spawning the server in its own process to eliminate lock contention: import time
from multiprocessing import Process, Queue
from pytest_sftpserver.sftp.server import SFTPServer
def run_server(q, contents):
sftpserver = SFTPServer(content_object=contents)
sftpserver.start()
q.put((sftpserver.host, sftpserver.port))
def test_some_stuff():
contents = {} # my contents structure here
queue = Queue()
p = Process(target=run_server, args=(queue, contents), daemon=True)
p.start()
for _ in range(10):
address = queue.get()
if address:
break
time.sleep(0.5)
assert address
# <do my testing here> |
To anyone coming here: This might be an alternative: https://github.com/oz123/pytest-localftpserver edit: ftp only :-( |
see : #30 (comment)
|
Thanks for this great utility, I'm trying to get it working now with a very simple example:
Where the connect is very simple and just does this
It works in theory but the test runner never quits it just hangs there forever.
Any idea why it's happening?
Is there something I can do to kill the sftpserver thread?
(I tried shutdown already but nothing..)
The text was updated successfully, but these errors were encountered: