Skip to content

Commit 2762b00

Browse files
committed
[uss_qualifier/astm] Make cleanup phase in down_uss use estimated extents as well
1 parent 780073c commit 2762b00

File tree

2 files changed

+11
-29
lines changed

2 files changed

+11
-29
lines changed

.basedpyright/baseline.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19468,22 +19468,6 @@
1946819468
"endColumn": 21,
1946919469
"lineCount": 1
1947019470
}
19471-
},
19472-
{
19473-
"code": "reportPossiblyUnboundVariable",
19474-
"range": {
19475-
"startColumn": 26,
19476-
"endColumn": 33,
19477-
"lineCount": 1
19478-
}
19479-
},
19480-
{
19481-
"code": "reportArgumentType",
19482-
"range": {
19483-
"startColumn": 39,
19484-
"endColumn": 49,
19485-
"lineCount": 1
19486-
}
1948719471
}
1948819472
],
1948919473
"./monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss_equal_priority_not_permitted.py": [

monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class DownUSS(TestScenario):
5757
scenario_execution_max_extents: Volume4D | None = None
5858
"""Actual bounding extent of the flight intents created by the USS qualifier acting as a virtual USS during the scenario execution."""
5959

60+
estimated_max_extents: Volume4D | None = None
61+
"""Estimated bounding extent of the flight intents created by the USS qualifier acting as a virtual USS during the scenario execution."""
62+
6063
tested_uss: FlightPlannerClient
6164
dss_resource: DSSInstanceResource
6265
dss: DSSInstance
@@ -167,7 +170,7 @@ def _setup(self):
167170
self.end_test_step()
168171

169172
self.begin_test_step("Clear operational intents created by virtual USS")
170-
self._clear_op_intents()
173+
self._clear_op_intents(estimated_max_extents)
171174
self.end_test_step()
172175

173176
self.begin_test_step("Verify area is clear")
@@ -295,33 +298,28 @@ def _plan_flight_conflict_planned(self):
295298

296299
self.end_test_step()
297300

298-
def _clear_op_intents(self):
301+
def _clear_op_intents(self, area):
299302
with self.check(
300303
"Successful operational intents cleanup", [self.dss.participant_id]
301304
) as check:
302-
if self.scenario_execution_max_extents is None:
303-
return
305+
oi_refs = []
304306

305307
try:
306-
oi_refs, find_query = self.dss.find_op_intent(
307-
self.scenario_execution_max_extents.to_f3548v21()
308-
)
308+
oi_refs, find_query = self.dss.find_op_intent(area.to_f3548v21())
309309
self.record_query(find_query)
310310
except QueryError as e:
311311
self.record_queries(e.queries)
312312
find_query = e.queries[0]
313313
check.record_failed(
314-
summary=f"Failed to query operational intent references from DSS in {self.scenario_execution_max_extents} for cleanup",
314+
summary=f"Failed to query operational intent references from DSS in {area} for cleanup",
315315
details=f"DSS responded code {find_query.status_code}; {e}",
316316
query_timestamps=[find_query.request.timestamp],
317317
)
318318

319319
for oi_ref in oi_refs:
320-
if oi_ref.manager == self.uss_qualifier_sub:
320+
if oi_ref.manager == self.uss_qualifier_sub and (ovn := oi_ref.ovn):
321321
try:
322-
del_oi, _, del_query = self.dss.delete_op_intent(
323-
oi_ref.id, oi_ref.ovn
324-
)
322+
_, _, del_query = self.dss.delete_op_intent(oi_ref.id, ovn)
325323
self.record_query(del_query)
326324
except QueryError as e:
327325
self.record_queries(e.queries)
@@ -336,6 +334,6 @@ def cleanup(self):
336334
self.begin_cleanup()
337335
set_uss_available(self, self.dss, self.uss_qualifier_sub)
338336
cleanup_flights(self, [self.tested_uss])
339-
self._clear_op_intents()
337+
self._clear_op_intents(self.scenario_execution_max_extents)
340338

341339
self.end_cleanup()

0 commit comments

Comments
 (0)