Operator mode clears the flapping history of the links it takes out

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 15:18:43 -04:00
co-authored by Claude Opus 5.5
parent 906f52e110
commit bf9afcbc84
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -2555,6 +2555,12 @@ class TestSwitches(unittest.TestCase):
self.assertEqual(tiles["lights"]["x"], "LIGHTS\nTAKING\nMIDI OUT")
tiles = self.engine.step(self.snap, SUNDAY + 120)
self.assertEqual(tiles["lights"]["x"], "LIGHTS\nOPERATOR\nMIDI OFF")
tr = next(t for k, t in self.engine.trackers.items() if self.engine.meta.get(k, (None, {}))[1] is self.midi
or (self.engine.meta.get(k, (None, {}))[1].get("peer") == self.midi["peer"]
and self.engine.meta[k][1].get("session") == self.midi["session"]))
tr.starts.extend([SUNDAY + 1, SUNDAY + 2, SUNDAY + 3]) # it had dropped three times before
self.engine.step(self.snap, SUNDAY + 121)
self.assertEqual(len(tr.starts), 0) # not called flapping once taken out
self.assertIn("lights", self.new_engine().bypass) # survives a restart
calls.clear()
self.engine.run_fixes("lights", self.snap, comp, SUNDAY + 130) # hold again: put back