Skip to content

Commit

Permalink
fixed some race conditions in logging
Browse files Browse the repository at this point in the history
  • Loading branch information
guillesanbri committed Nov 1, 2024
1 parent c42a262 commit bce4e16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_universal_api/test_utils/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
],
},
"timestamp": (start_time + timedelta(seconds=0.01)).strftime("%Y-%m-%d, %H:%M:%S"),
"timestamp": (start_time + timedelta(seconds=10)).strftime("%Y-%m-%d, %H:%M:%S"),
"tags": [tag],
}

Expand Down Expand Up @@ -79,7 +79,7 @@ def test_get_queries_from_manual():
assert len(history) == 1
history = unify.get_queries(
endpoints="local_model_test@external",
start_time=(datetime.now(timezone.utc) + timedelta(seconds=1)).strftime("%Y-%m-%d %H:%M:%S"),
start_time=(datetime.now(timezone.utc) + timedelta(seconds=10)).strftime("%Y-%m-%d %H:%M:%S"),
)
assert len(history) == 0

Expand All @@ -92,12 +92,12 @@ def test_get_queries_from_chat_completion():
)
history = unify.get_queries(
endpoints="gpt-4o@openai",
start_time=start_time,
start_time=(start_time - timedelta(seconds=30)).strftime("%Y-%m-%d %H:%M:%S"),
)
assert len(history) == 1
history = unify.get_queries(
endpoints="gpt-4o@openai",
start_time=datetime.now(timezone.utc) + timedelta(seconds=1),
start_time=(datetime.now(timezone.utc) + timedelta(seconds=1)).strftime("%Y-%m-%d %H:%M:%S"),
)
assert len(history) == 0

Expand Down

0 comments on commit bce4e16

Please sign in to comment.