def _build_keystone_client(self, vim_account: dict) -> keystone_client.Client:
sess = OpenstackUtils.get_session(vim_account)
- return keystone_client.Client(session=sess)
+ return keystone_client.Client(session=sess, timeout=10)
def _build_nova_client(self, vim_account: dict) -> nova_client.Client:
sess = OpenstackUtils.get_session(vim_account)
- return nova_client.Client("2", session=sess)
+ return nova_client.Client("2", session=sess, timeout=10)
processes.append(p)
p.start()
for process in processes:
- process.join(timeout=10)
+ process.join(timeout=20)
+ for process in processes:
+ if process.is_alive():
+ process.kill()
metrics = []
while not self.queue.empty():
metrics.append(self.queue.get())
project_name=creds['vim_tenant_name'],
project_domain_name=project_domain_name,
user_domain_name=user_domain_name)
- return session.Session(auth=auth, verify=verify_ssl)
+ return session.Session(auth=auth, verify=verify_ssl, timeout=10)
OpenstackUtils.get_session(creds)
mock_session.Session.assert_called_once_with(
- auth=mock.ANY, verify=True)
+ auth=mock.ANY, verify=True, timeout=10)
def test_session_with_insecure(self, mock_session):
creds = {
OpenstackUtils.get_session(creds)
mock_session.Session.assert_called_once_with(
- auth=mock.ANY, verify=False)
+ auth=mock.ANY, verify=False, timeout=10)
def test_session_with_insecure_false(self, mock_session):
creds = {
}
OpenstackUtils.get_session(creds)
mock_session.Session.assert_called_once_with(
- auth=mock.ANY, verify=True)
+ auth=mock.ANY, verify=True, timeout=10)