cmu-mars / brasscomms

0 stars 1 forks source link

ordering of end point use #54

Closed ivoysey closed 7 years ago

ivoysey commented 7 years ago

right now there's no check that they don't observe before start, or perturb before start, or whatever. these things could cause us to fail tests if the TH is buggy, they think they're perturbed, they haven't and it gets over written some how, and then we act like they haven't.

ivoysey commented 7 years ago

53 is a special case of this where it's really clear what to do: if you have multiple starts, you restart mid-mission, so that's a sufficiently catastrophic event to warrant a runtime check.

ivoysey commented 7 years ago

this table assumes that the arguments that are about to be used in a particular interaction with one of the end points are valid. so remove_obstacle can always be called -- but dynamically you can only actually produce valid arguments if place_obstacle has succeeded at least once.

endpoint possible preconditions
query_path always fine
start affine
observe either "always fine" or "always fine once start gets hit" -- the deadline is bogus until the mission starts, but it will never crash
set_battery always fine, modulo @cyrus-'s battery model. it's odd to set the battery to be higher than it is; do we want to ban that?
place_obstacle always fine
remove_obstacle always fine (implicitly: only after at least one place_obstacle succeeds)
perturb_sensor always fine, modulo joydeep's stuff.
ivoysey commented 7 years ago
ivoysey commented 7 years ago

talking to @schmerl today, we decided that it wasn't worth dynamically checking and enforcing this. it amounts to implementing the automaton as actual code, which is a lot of work, and adds a lot more state to the nominally stateless REST API.

choosing to not do that makes our implementation more brittle, and forensics harder if we need to figure out why we're failing tests and the answer is that either the MIT/LL TH or our mini-TH is calling things out of order, but such is life.

if that becomes really bad, we can add more info messages to logging to effectively write our own version of the test history as we observe it.