Commit 2791ebd3 authored by Jérome Perrin's avatar Jérome Perrin

software/*/test: waitForInstance a bit more for softwares with missing promises

Now that slapos node instance no longer use --all, some software release test
revealed some problems with softwares, either missing promises or maybe
something that needs to be handled in slapos.core.
Using --all was wrong and we want to stop doing this now.
This commit is a workaround to keep the test passing, we should not have to
use waitForInstance more than once like this. Something when running slapos
node instance should detect that instance is not ready on the first run.
parent 43b029e1
Pipeline #14954 failed with stage
in 0 seconds
......@@ -5769,8 +5769,9 @@ class TestSlaveSlapOSMasterCertificateCompatibility(
partition_reference='custom_domain_ssl_crt_ssl_key_ssl_ca_crt',
partition_parameter_kw=slave_parameter_dict,
)
self.slap.waitForInstance()
# XXX run instance twice because of missing promise
for _ in range(2):
self.slap.waitForInstance()
self.runKedifaUpdater()
result = fakeHTTPSResult(
parameter_dict['domain'], 'test-path')
......@@ -6112,13 +6113,15 @@ class TestSlaveRejectReportUnsafeDamaged(SlaveHttpFrontendTestCase):
super(TestSlaveRejectReportUnsafeDamaged, cls).setUpClass()
cls.fillSlaveParameterDictDict()
cls.requestSlaves()
try:
cls.slap.waitForInstance(
max_retry=2 # two runs shall be enough
)
except Exception:
# ignores exceptions, as problems are tested
pass
# XXX run instance twice because of missing promise
for _ in range(2):
try:
cls.slap.waitForInstance(
max_retry=2 # two runs shall be enough
)
except Exception:
# ignores exceptions, as problems are tested
pass
cls.updateSlaveConnectionParameterDictDict()
slave_parameter_dict_dict = {}
......
......@@ -233,10 +233,23 @@ class EdgeSlaveMixin(MonitorTestMixin):
)
def initiateSurykatkaRun(self):
try:
self.slap.waitForInstance(max_retry=2)
except Exception:
pass
# XXX we run twice as a workaround for the fact that after requesting new
# shared instances we don't have promise to wait for the processing of
# these shared instances to be completed.
# The sequence is something like this:
# - `requestEdgetestSlaves` will request edgetest partition
# - first `waitForInstance` will process the edgetest partition, which will
# request a edgebot partition, but without promise to wait for the
# processing to be finished, so the first run of `slapos node instance`
# exits with success code and `waitForInstance` return.
# - second `waitForInstance` process the edgebot partition.
# Once we implement a promise (or something similar) here, we should not
# have to run twice.
for _ in range(2):
try:
self.slap.waitForInstance(max_retry=2)
except Exception:
pass
def assertSurykatkaStatusJSON(self):
for info_dict in self.surykatka_dict.values():
......
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