From 98472ab8cb2019767d256e3a587463f27bf1660c Mon Sep 17 00:00:00 2001 From: Eugene Olonov Date: Fri, 16 Oct 2026 21:28:54 -0700 Subject: [PATCH] Reject non-finite --min-age in cleanup-grid-sessions.py --- .../webchat-html-tests/scripts/cleanup-grid-sessions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/skills/webchat-html-tests/scripts/cleanup-grid-sessions.py b/.github/skills/webchat-html-tests/scripts/cleanup-grid-sessions.py index b25786a271..6b296b3833 100755 --- a/.github/skills/webchat-html-tests/scripts/cleanup-grid-sessions.py +++ b/.github/skills/webchat-html-tests/scripts/cleanup-grid-sessions.py @@ -2,6 +2,7 @@ import argparse import json +import math import os import sys import urllib.error @@ -29,7 +30,10 @@ def parse_arguments(): arguments = parser.parse_args() - arguments.min_age is not None and arguments.min_age < 0 and parser.error('--min-age must not be negative') + # `float()` accepts "nan" and "inf", which break the age comparison, e.g. `age < nan` is always false. + arguments.min_age is not None and not ( + math.isfinite(arguments.min_age) and arguments.min_age >= 0 + ) and parser.error('--min-age must be a finite number of seconds, zero or more') return arguments