Skip to content

Commit

Permalink
Fixed per PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
punamverma committed Dec 13, 2023
1 parent 1405f0e commit 694ff22
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ def _tested_uss_plans_deconflicted_flight_near_existing_flight(
)

if get_requested == False and already_notified == True:
msg = f"GET request was not made by tested_uss, as it was notified of flight2, due to an exisitng subscription."
msg = (
f"GET request was not made by tested_uss, as it was notified of flight2, due to an existing subscription. "
f"See documentation of test step - Check for notification to tested_uss due to subscription in flight 2 area"
)
raise ScenarioCannotContinueError(msg)

expect_interuss_post_interactions(
Expand Down Expand Up @@ -246,14 +249,14 @@ def _tested_uss_unable_to_plan_flight_near_invalid_shared_existing_flight(
)

additional_fields = {"behavior": behavior}
planning_time = Time(arrow.utcnow().datetime)
with OpIntentValidator(
self,
self.control_uss_client,
self.dss,
"Validate flight 2 shared operational intent with invalid data",
self._intents_extent,
) as validator:
planning_time = Time(arrow.utcnow().datetime)
_, self.flight_2_id = plan_flight(
self,
"Control_uss plans flight 2, sharing invalid operational intent data",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ def _get_interuss_interactions_with_check(
) -> Tuple[List[Interaction], Query]:
"""
Method to get interuss interactions with a scenario check from mock_uss from time 'st' to now.
Args:
wait_time_sec: Seconds to wait for getting interactions like asynchronous notifications
"""
with scenario.check(
"MockUSS interactions request", [mock_uss.participant_id]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This step verifies when a flight is not created, it is also not notified by chec

**[interuss.f3548.notification_requirements.NoDssEntityNoNotification](../../../../../requirements/interuss/f3548/notification_requirements.md)**

As per astm requirement, the notification should not be sent by a USS about an entity that could not be created in DSS
As per the above requirement, the notification should not be sent by a USS about an entity that could not be created in DSS
to any USS. To verify that notification was indeed not sent, we need to wait and check up to a threshold to get confidence
that USS did not send notification.
The max duration for sending a notification in [SCD0085](../../../../../requirements/astm/f3548/v21.md) is MaxRespondToSubscriptionNotification(5) seconds.
Expand Down
23 changes: 13 additions & 10 deletions monitoring/uss_qualifier/scenarios/astm/utm/test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def _evaluate_op_intent_validation(
if errors:
validation_failures.add(
OpIntentValidationFailure(
validation_name=OpIntentValidationFailureType.DataFormat,
validation_failure_type=OpIntentValidationFailureType.DataFormat,
errors=errors,
)
)
Expand All @@ -464,7 +464,7 @@ def _evaluate_op_intent_validation(
details = f"Operational intent {oi_full.reference.id} had {len(oi_full.details.off_nominal_volumes)} off-nominal volumes in wrong state - {oi_full.reference.state}"
validation_failures.add(
OpIntentValidationFailure(
validation_name=OpIntentValidationFailureType.NominalWithOffNominalVolumes,
validation_failure_type=OpIntentValidationFailureType.NominalWithOffNominalVolumes,
error_text=details,
)
)
Expand All @@ -485,12 +485,12 @@ def volume_vertices(v4):
f"Operational intent {oi_full.reference.id} had too many total vertices - {n_vertices}",
)
validation_failures.add(
validation_name=OpIntentValidationFailureType.VertexCount,
validation_failure_type=OpIntentValidationFailureType.VertexCount,
error_text=details,
)
except (KeyError, ValueError) as e:
validation_failures.add(
validation_name=OpIntentValidationFailureType.DataFormat,
validation_failure_type=OpIntentValidationFailureType.DataFormat,
error_text=e,
)

Expand All @@ -512,7 +512,7 @@ def _expected_validation_failure_found(
"""
failure_found: OpIntentValidationFailure = None
for failure in validation_failures:
if failure.validation_name == expected_validation_type:
if failure.validation_failure_type == expected_validation_type:
failure_found = failure

if failure_found:
Expand Down Expand Up @@ -554,8 +554,7 @@ class OpIntentValidationFailureType(str, Enum):


class OpIntentValidationFailure(ImplicitDict):
validation_name: OpIntentValidationFailureType
"""Validation name same as the check name"""
validation_failure_type: OpIntentValidationFailureType

error_text: Optional[str] = None
"""Any error_text returned after validation check"""
Expand All @@ -564,12 +563,16 @@ class OpIntentValidationFailure(ImplicitDict):
"""Any errors returned after validation check"""

def __hash__(self):
return hash((self.validation_name, self.error_text, str(self.errors)))
return hash((self.validation_failure_type, self.error_text, str(self.errors)))

def __eq__(self, other):
if isinstance(other, OpIntentValidationFailure):
return (self.validation_name, self.error_text, str(self.errors)) == (
other.validation_name,
return (
self.validation_failure_type,
self.error_text,
str(self.errors),
) == (
other.validation_failure_type,
other.error_text,
str(other.errors),
)
Expand Down

0 comments on commit 694ff22

Please sign in to comment.