Commit 464082fd authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Follow SlapOS guidelines about instance processing

Drop hacks applied in the test, so that it will uncover all missing promises
and corner cases.
parent a2240005
...@@ -82,9 +82,6 @@ else: ...@@ -82,9 +82,6 @@ else:
os.path.abspath( os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg'))) os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
# XXX Keep using slapos node instance --all, because of missing promises
SlapOSInstanceTestCase.slap._force_slapos_node_instance_all = True
# ports chosen to not collide with test systems # ports chosen to not collide with test systems
HTTP_PORT = '11080' HTTP_PORT = '11080'
HTTPS_PORT = '11443' HTTPS_PORT = '11443'
...@@ -2119,9 +2116,18 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -2119,9 +2116,18 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
def writeNodeInformation(node_information, path): def writeNodeInformation(node_information, path):
with open(path, 'w') as fh: with open(path, 'w') as fh:
json.dump(node_information, fh, sort_keys=True) json.dump(node_information, fh, sort_keys=True)
self.waitForInstance() # full processing is needed as this is just simulation which does
self.waitForInstance() # not bang the instance tree
self.waitForInstance() slap_force_slapos_node_instance_all = \
self.slap._force_slapos_node_instance_all
self.slap._force_slapos_node_instance_all = True
try:
self.waitForInstance()
self.waitForInstance()
self.waitForInstance()
finally:
self.slap._force_slapos_node_instance_all = \
slap_force_slapos_node_instance_all
self.addCleanup( self.addCleanup(
writeNodeInformation, current_node_information, writeNodeInformation, current_node_information,
...@@ -5977,9 +5983,7 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase): ...@@ -5977,9 +5983,7 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
cls.fillSlaveParameterDictDict() cls.fillSlaveParameterDictDict()
cls.requestSlaves() cls.requestSlaves()
try: try:
cls.slap.waitForInstance( cls.slap.waitForInstance(max_retry=10)
max_retry=2 # two runs shall be enough
)
except Exception: except Exception:
# ignores exceptions, as problems are tested # ignores exceptions, as problems are tested
pass pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment