130
130
master.scanSlaves()
131
131
self.assertEqual(1, builder.contiguous_errors)
133
def test_scan_slaves_error_count_over_limit(self):
135
When we detect the master going over the limit, we should set the
136
builder is_okay flag to false and notify a problem.
138
log_file = self.capture_logging(log_level=logging.DEBUG)
139
self.config.set("master", "builder_error_limit", "3")
140
master, builder = self.build_builder_and_slave_with_job_and_result(
141
result=ProjectBuildStates.FAILED,
144
self.assertEqual(4, builder.contiguous_errors)
146
builder.is_okay, "Builder.is_okay is True when it should be false")
147
# We get two emails, one for the failed build, which is sent to the
148
# people subscribed to the project and the other...
149
self.assertEqual(2, len(self.mailer.mails))
150
sender, recpt, message = self.mailer.mails[1]
152
"Subject: Build slave %s has reached error limit" %
153
builder.name in message,
154
"Incorrect subject for notification email")
133
156
def test_scan_slaves_non_error_resets_error_count(self):
135
158
When a builder has a non-erroring build, the contiguous_errors