aboutsummaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2023-12-07 11:28:52 +0000
committerDavid Spickett <david.spickett@linaro.org>2023-12-07 11:28:52 +0000
commit52555293bc07e0c642deb0c84f27883c8bc519a5 (patch)
treea73e164109392d407b318e6c4a0e869ce7769c04 /monitor
parent2742055d0a570de573b0fc638193786d219b75c2 (diff)
llvmbot monitor: Handle missing complete_at fieldHEADmaster
For some reason just now we were getting a successful build without a completed time. That's fixed itself now but I might as well add the code I wrote to handle it anyway. Probably a glitch on Buildbot's side. Change-Id: I049da16cf126865ce7d054eca8677da10a3377dc
Diffstat (limited to 'monitor')
-rwxr-xr-xmonitor/bot-status.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/monitor/bot-status.py b/monitor/bot-status.py
index a030d3e..6e37def 100755
--- a/monitor/bot-status.py
+++ b/monitor/bot-status.py
@@ -110,10 +110,12 @@ def get_bot_status(session, bot, base_url, builder_url, build_url):
status["first_fail_url"] = "{}/builds/{}".format(
agent_url, first_fail["number"]
)
- fail_since = int(datetime.now().timestamp()) - int(
- first_fail["complete_at"]
- )
- status["fail_since"] = timedelta(seconds=fail_since)
+ # Occasionaly we find a finished build without complete_at,
+ # it may be an intermitent issue on Buildbot's side.
+ complete_at = first_fail.get("complete_at")
+ if complete_at is not None:
+ fail_since = int(datetime.now().timestamp()) - int(complete_at)
+ status["fail_since"] = timedelta(seconds=fail_since)
break
first_fail = build
else: