autopkgtest: Publish AMQP messages persistently

We want to ask the broker to write them out to disk, hoepfully
mitigating against it crashing.
This commit is contained in:
Iain Lane 2018-12-06 09:35:39 +00:00
parent f63ba5106e
commit 37ba086adf
No known key found for this signature in database
GPG Key ID: E352D5C51C5041D4

View File

@ -952,7 +952,9 @@ class AutopkgtestPolicy(BasePolicy):
params = json.dumps(params)
if self.amqp_channel:
self.amqp_channel.basic_publish(amqp.Message(src + '\n' + params), routing_key=qname)
self.amqp_channel.basic_publish(amqp.Message(src + '\n' + params,
delivery_mode=2), # persistent
routing_key=qname)
else:
assert self.amqp_file
with open(self.amqp_file, 'a') as f: