Skip to content

Commit

Permalink
fix(load_testing): Set timezone to America/New_York (#226)
Browse files Browse the repository at this point in the history
* fix(load_testing): Set timezone to America/New_York

* fix: add back other tasks

* style: run formatting
  • Loading branch information
KaylaBrady authored Oct 25, 2024
1 parent 8af1b57 commit e488f4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion load_testing/locustfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import random
from zoneinfo import ZoneInfo

import requests
from locust import HttpUser, between, events, task
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit e488f4b

Please sign in to comment.