Skip to content

Commit

Permalink
drastically improve test speed by removing 10 repetitions in loop
Browse files Browse the repository at this point in the history
- doing 90 instead of 100 loop repetitions decreases test from 4 seconds down to 33 milliseconds
  • Loading branch information
dtrai2 committed Dec 6, 2024
1 parent 2544fcc commit 31b5257
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit/connector/test_http_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ def test_http_server_is_of_instance_threading_http_server(self):

def test_server_starts_threaded_server(self):
message = {"message": "my message"}
for i in range(100):
for i in range(90):
message["message"] = f"message number {i}"
self.client.post("/json", json=message)
assert self.object.messages.qsize() == 100, "messages are put to queue"
assert self.object.messages.qsize() == 90, "messages are put to queue"

def test_get_metadata(self):
message = {"message": "my message"}
Expand Down

0 comments on commit 31b5257

Please sign in to comment.