We only want to try to list_locks() for getting arch by
machine_type when scheduling a suite. Otherwise we've
got into an infinite loop and console log flooded
with useless error messages.
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@clyso.com>
def test_get_arch_fail(self, m_query):
m_query.list_locks.return_value = False
util.get_arch('magna')
- m_query.list_locks.assert_called_with(machine_type="magna", count=1)
+ m_query.list_locks.assert_called_with(machine_type="magna", count=1, tries=1)
@patch('teuthology.lock.query')
def test_get_arch_success(self, m_query):
result = util.get_arch('magna')
m_query.list_locks.assert_called_with(
machine_type="magna",
- count=1
+ count=1, tries=1
)
assert result == "arch"
:returns: A string or None
"""
- result = teuthology.lock.query.list_locks(machine_type=machine_type, count=1)
+ result = teuthology.lock.query.list_locks(machine_type=machine_type, count=1, tries=1)
if not result:
log.warning("No machines found with machine_type %s!", machine_type)
else: