test: increase number of tries to find tz not near midnight (#4756)

This commit is contained in:
Jennifer Richards 2022-11-15 09:53:21 -04:00 committed by GitHub
parent 611d732869
commit 36bbc9bc08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,7 +96,7 @@ def timezone_not_near_midnight():
right_now = timezone.now().astimezone(ZoneInfo(tzname)) right_now = timezone.now().astimezone(ZoneInfo(tzname))
# Avoid the remote possibility of an infinite loop (might come up # Avoid the remote possibility of an infinite loop (might come up
# if there is a problem with the time zone library) # if there is a problem with the time zone library)
tries_left = 20 tries_left = 50
while right_now.hour < 1 or right_now.hour >= 23: while right_now.hour < 1 or right_now.hour >= 23:
tzname = random.choice(timezone_options) tzname = random.choice(timezone_options)
right_now = right_now.astimezone(ZoneInfo(tzname)) right_now = right_now.astimezone(ZoneInfo(tzname))