Repository navigation
Restore the DUT through cleanup, and let a procedure end early - #61
Merged
Merged
Conversation
Several procedures restored the DUT in their last step, which never ran when an earlier step failed, so later procedures in the run found points uninstalled or link confirms on: 2.7's configurable-device input and output procedures, 6.6.3, and 3.1r1's 8.21.1. Others wrapped each step in their own restore-on-failure code. All of them now restore in the procedure's cleanup, which the runner runs however the procedure ends. - A definition can build its steps and cleanup together (plan), so the cleanup knows what the steps changed. Undoable arms its undo before the change runs, and undoes it once, only if it ran. - A step ends a procedure early, as a level 1 or 2 device may, by throwing EndProcedure: the runner skips the remaining steps, then runs the deferred checks and the cleanup. It replaces the skipped flags in StaticVariations, EventVariations and AssignClass. - A definition states the configuration it needs (configurationProblems); a run collects them from the procedures it will run. They replace the checks registered by hand in Revision. - ProcedureDefinition.requiring replaces StaticInputs.Requiring, which dropped the inner cleanup and didn't list its extra condition. 2.7's -describe output is unchanged. Part of #59.
jadamcrain
force-pushed
the
cleanup-restore
branch
from
October 14, 2026 21:04
4af0a8c to
8e6ab9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item 2 of #59. Stacked on #60, so this PR's base is #60's branch. Once #60 merges, I'll rebase onto main.
Bug fixed. Several procedures restored the DUT in their last step. That step never ran when an earlier one failed, so later procedures in a
-run allfound the DUT still changed:They now restore in the procedure's cleanup, which the runner runs however the procedure ends.
One mechanism for restoring the DUT
ProcedureDefinition.planreturns both, so the cleanup can see what the steps changed. Ordinary definitions still overridesteps, which now has a default that throws, so they gained anoverridemodifier.Undoable. It arms its undo just before the change runs. The undo then runs once, and only if the change ran.PointRanges,StaticVariations,AssignClassandOutputEventsnow use cleanup. Restores that a procedure publishes as steps stay where the procedure has them: 8.23 x.1's "points are back" step and 8.26.2's step 46.Ending early. A step throws
EndProcedurewhen the DUT answers as a level 1 or 2 device may. The runner then skips the remaining steps and runs the deferred checks and the cleanup. It's aControlThrowable, soTrydoesn't catch it. This replaces theskippedflags inStaticVariations,EventVariationsandAssignClass.Configuration checks. Each definition can now report the configuration problems that stop it from running (
configurationProblems), and a run collects them from the procedures it will run, removing duplicates.Revision. Checks that apply to the whole revision stay central, inEventRules.requiringandRequirement.allProcedureDefinition.requiringreplacesStaticInputs.Requiring, which dropped the inner procedure's cleanup and didn't list its extra condition.Requirement.allflattens nestedalls.Testing
-describeoutput is byte-identical across 227 procedures and three configurations.CleanupTestcovers ending early,Undoable, a restore after a failure at each bug site,requiring, and the run's configuration checks.AssignClassTestcovers the class counts.