Skip to content

Commit

Permalink
[uss_qualifier] Fix query timestamp property reference (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminPelletier authored Oct 3, 2024
1 parent 8f2dc53 commit 50daecb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions monitoring/monitorlib/fetch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,12 @@ class Query(ImplicitDict):
query_type: Optional[QueryType]
"""If specified, the recognized type of this query."""

@property
def timestamp(self) -> datetime.datetime:
"""Safety property to prevent crashes when Query.timestamp is accessed.
For intentional access, request.timestamp should be used instead."""
return self.request.timestamp

@property
def status_code(self) -> int:
return self.response.status_code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ def _evaluate_versions(
mismatch_timestamps = []
for participant_id in mismatched_participants:
timestamps = [
test_env_versions[participant_id].query.timestamp,
prod_env_versions[participant_id].query.timestamp,
test_env_versions[participant_id].query.request.timestamp,
prod_env_versions[participant_id].query.request.timestamp,
]
with self.check(
"Test software version matches production", participants=participant_id
Expand Down

0 comments on commit 50daecb

Please sign in to comment.