From e488f4b48b9f7d9cecf737a70c07f6b54b39c7b1 Mon Sep 17 00:00:00 2001 From: Kayla Brady <31781298+KaylaBrady@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:09:07 -0400 Subject: [PATCH] fix(load_testing): Set timezone to America/New_York (#226) * fix(load_testing): Set timezone to America/New_York * fix: add back other tasks * style: run formatting --- load_testing/locustfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/load_testing/locustfile.py b/load_testing/locustfile.py index f24c5e3..504d688 100644 --- a/load_testing/locustfile.py +++ b/load_testing/locustfile.py @@ -1,5 +1,6 @@ import datetime import random +from zoneinfo import ZoneInfo import requests from locust import HttpUser, between, events, task @@ -96,7 +97,7 @@ def nearby_transit(self): @task(5) def stop_details(self): self.stop_id = random.choice(all_stop_ids) - self.client.get(f'/api/schedules?stop_ids={self.stop_id}&date_time={datetime.datetime.now().astimezone().replace(microsecond=0).isoformat()}' , name="/api/schedules",) + self.client.get(f'/api/schedules?stop_ids={self.stop_id}&date_time={datetime.datetime.now().astimezone(ZoneInfo("America/New_York")).replace(microsecond=0).isoformat()}' , name="/api/schedules",) self.client.get(f'/api/stop/map?stop_id={self.stop_id}', name = "/api/stop/map") if (