Merge ~vorlon/britney/+git/britney2-ubuntu:no-die-on-rabbitmq-failure into ~ubuntu-release/britney/+git/britney2-ubuntu:master

Proposed by Steve Langasek
Status: Merged
Merged at revision: 9e28fceafab53fa6a3f9994295a28fe490c3bfe7
Proposed branch: ~vorlon/britney/+git/britney2-ubuntu:no-die-on-rabbitmq-failure
Merge into: ~ubuntu-release/britney/+git/britney2-ubuntu:master
Diff against target: 59 lines (+16/-9)
1 file modified
britney2/policies/autopkgtest.py (+16/-9)
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+463777@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

hit this again today while queuing a million perl tests...

Revision history for this message
Brian Murray (brian-murray) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py
index 264a34c..1dd3be4 100644
--- a/britney2/policies/autopkgtest.py
+++ b/britney2/policies/autopkgtest.py
@@ -1123,9 +1123,11 @@ class AutopkgtestPolicy(BasePolicy):
11231123
1124 If huge is true, then the request will be put into the -huge instead of1124 If huge is true, then the request will be put into the -huge instead of
1125 normal queue.1125 normal queue.
1126
1127 Return True if successfully queued, False if not.
1126 '''1128 '''
1127 if self.options.dry_run or self.dry_run:1129 if self.options.dry_run or self.dry_run:
1128 return1130 return True
11291131
1130 params = {'triggers': triggers}1132 params = {'triggers': triggers}
1131 if self.options.adt_ppas:1133 if self.options.adt_ppas:
@@ -1140,9 +1142,12 @@ class AutopkgtestPolicy(BasePolicy):
1140 if self.amqp_channel:1142 if self.amqp_channel:
1141 import amqplib.client_0_8 as amqp1143 import amqplib.client_0_8 as amqp
1142 params = json.dumps(params)1144 params = json.dumps(params)
1143 self.amqp_channel.basic_publish(amqp.Message(src + '\n' + params,1145 try:
1144 delivery_mode=2), # persistent1146 self.amqp_channel.basic_publish(amqp.Message(src + '\n' + params,
1145 routing_key=qname)1147 delivery_mode=2), # persistent
1148 routing_key=qname)
1149 except ConnectionResetError:
1150 return False
1146 else:1151 else:
1147 # for file-based submission, triggers are space separated1152 # for file-based submission, triggers are space separated
1148 params['triggers'] = [' '.join(params['triggers'])]1153 params['triggers'] = [' '.join(params['triggers'])]
@@ -1150,6 +1155,7 @@ class AutopkgtestPolicy(BasePolicy):
1150 assert self.amqp_file1155 assert self.amqp_file
1151 with open(self.amqp_file, 'a') as f:1156 with open(self.amqp_file, 'a') as f:
1152 f.write('%s:%s %s\n' % (qname, src, params))1157 f.write('%s:%s %s\n' % (qname, src, params))
1158 return True
11531159
1154 def pkg_test_request(self, src, arch, full_triggers, huge=False):1160 def pkg_test_request(self, src, arch, full_triggers, huge=False):
1155 '''Request one package test for one particular trigger1161 '''Request one package test for one particular trigger
@@ -1219,11 +1225,12 @@ class AutopkgtestPolicy(BasePolicy):
1219 self.logger.info('Test %s/%s for %s is already pending, not queueing', src, arch, trigger)1225 self.logger.info('Test %s/%s for %s is already pending, not queueing', src, arch, trigger)
1220 else:1226 else:
1221 self.logger.info('Requesting %s autopkgtest on %s to verify %s', src, arch, trigger)1227 self.logger.info('Requesting %s autopkgtest on %s to verify %s', src, arch, trigger)
1222 arch_list.append(arch)1228 if self.send_test_request(src, arch, full_triggers, huge=huge):
1223 arch_list.sort()1229 # save pending.json right away, so that we don't re-request
1224 self.send_test_request(src, arch, full_triggers, huge=huge)1230 # if britney crashes
1225 # save pending.json right away, so that we don't re-request if britney crashes1231 arch_list.append(arch)
1226 self.save_pending_json()1232 arch_list.sort()
1233 self.save_pending_json()
12271234
1228 def result_in_baseline(self, src, arch):1235 def result_in_baseline(self, src, arch):
1229 '''Get the result for src on arch in the baseline1236 '''Get the result for src on arch in the baseline

Subscribers

People subscribed via source and target branches