-
Notifications
You must be signed in to change notification settings - Fork 199
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
AssertionError: Docker container '...' contained extra running processes after test completed #694
Comments
This test also sometimes has issues, maybe 4/10 test runs:
https://travis-ci.org/dw/mitogen/jobs/653673605?utm_medium=notification&utm_source=github_status example test fail |
doas_test.py
on Python: 2.6 MODE=mitogen DISTRO=centos7
This still occurs intermittently on Azure Devops. While experimenting with Github Actions I'm seeing it reliably fail as follows, in py36-mode_mitogen-distro_centos7
The following changes to testlib.py and ssh_test.py in isolation each made it go away, I haven't tested them in combination @@ -609,6 +625,8 @@ def setUp(self):
self.router = self.router_class(self.broker)
def tearDown(self):
+ self.router.disconnect_all()
+ self.router.__exit__(None, None, None)
del self.router
super(RouterMixin, self).tearDown()
@@ -595,6 +614,7 @@ def tearDown(self):
self.broker.shutdown()
self.broker.join()
del self.broker
+ time.sleep(1.0)
super(BrokerMixin, self).tearDown()
def sync_with_broker(self): @@ -190,6 +190,7 @@ def test_verbose_enabled(self):
self.dockerized_ssh.port,
)
self.assertEqual(name, context.name)
+ context.shutdown(wait=True)
class StubPermissionDeniedTest(StubSshMixin, testlib.TestCase): My hypothesis is that the ssh connection is being left open by Mitogen, or it is relying on th GC to do cleanup, or we are closing the connection asynchronously and not waiting for it to complete. |
Further testing revealed this is false. They might reduce occurence, but they haven't eliminated it. |
I'm starting to think this is a combination of
My guesstimate: After the TCP socket is closed (by the client or the server) sshd will take some non-zero amount of time to exit or terminate the session processes. Since there is no communcation channel between the client and server, there is not way for the test suite to wait for the server processes to be gone. If so, then the least worst option to address item 2 is waiting a short period before calling |
I'm about 75% sure the check is an unavoidable race condition, see mitogen-hq#694 (comment). If it occurs again, then reopen the issue. Fixes mitogen-hq#694
https://travis-ci.org/dw/mitogen/jobs/653211748?utm_medium=notification&utm_source=github_status
Sometimes tests fail with:
The text was updated successfully, but these errors were encountered: