Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pjenvey committed Feb 3, 2024
1 parent f6fd8d7 commit 57616b7
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/load/locustfiles/stored.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
from logging import Logger
from typing import Any, TypeAlias

import gevent
import websocket
from args import parse_wait_time
from exceptions import ZeroStatusRequestError
from gevent import Greenlet
from locust import FastHttpUser, events, task
from locust.exception import LocustError
from models import (
Expand All @@ -38,9 +36,6 @@
Message: TypeAlias = HelloMessage | NotificationMessage | RegisterMessage | UnregisterMessage
Record: TypeAlias = HelloRecord | NotificationRecord | RegisterRecord

# Set to 'True' to view the verbose connection information for the web socket
#websocket.enableTrace(False)
#websocket.setdefaulttimeout(5)

logger: Logger = logging.getLogger("StoredNotifAutopushUser")

Expand All @@ -65,8 +60,7 @@ def __init__(self, environment) -> None:
self.register_records: list[RegisterRecord] = []
self.unregister_records: list[RegisterRecord] = []
self.uaid: str = ""
self.ws: WebSocketApp | None = None
self.ws_greenlet: Greenlet | None = None
self.ws: WebSocket | None = None

def wait_time(self):
return self.environment.autopush_wait_time(self)
Expand All @@ -82,8 +76,6 @@ def on_stop(self) -> Any:
self.send_unregister(self.ws, channel_id)
self.ws.close()
self.ws = None
if self.ws_greenlet:
gevent.kill(self.ws_greenlet)

def on_ws_open(self, ws: WebSocket) -> None:
"""Called when opening a WebSocket.
Expand Down Expand Up @@ -362,7 +354,7 @@ def send_register(self, ws: WebSocket, channel_id: str) -> None:
self.register_records.append(record)
self.send(ws, message_type, data)

def send_unregister(self, ws: WebSocketApp, channel_id: str) -> None:
def send_unregister(self, ws: WebSocket, channel_id: str) -> None:
"""Send an 'unregister' message to Autopush.
Args:
Expand Down

0 comments on commit 57616b7

Please sign in to comment.