MIDI hold re-adds a peer stuck half-connected
After the network test SuperRack sat in NA Ingest's session as
"initializing"; the hold saw it listed and did nothing ("already").
connect_peer now drops a listed-but-not-live peer and adds it back,
building the second write from the first so a slow re-read cannot leave
it dropped. Tested live today: DVS x4, APPS and INGEST holds, NET clear,
CAPTIONS and BRIDGE restart keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -789,6 +789,24 @@ class TestFixes(unittest.TestCase):
|
||||
self.assertEqual(back, sess)
|
||||
self.assertIsNone(coremidi.without_peer(sess, "Lighting PC")) # not there
|
||||
|
||||
def test_a_peer_stuck_initializing_is_kicked(self):
|
||||
import coremidi
|
||||
from unittest import mock
|
||||
sess = {"dns-sd-name": "NA Ingest", "port": 5009, "peers": [
|
||||
{"name": "Lighting PC", "address": "10.1.10.206:5004", "state": "running"},
|
||||
{"name": "SuperRack-LiveBox", "address": "10.1.13.140:5004", "state": "initializing"}]}
|
||||
self.assertTrue(coremidi.stuck_peer(sess, "SuperRack-LiveBox"))
|
||||
self.assertFalse(coremidi.stuck_peer(sess, "Lighting PC"))
|
||||
writes = []
|
||||
with mock.patch.object(coremidi, "_session_entities", return_value=[(1, sess)]), \
|
||||
mock.patch.object(coremidi, "_string_prop", return_value=None), \
|
||||
mock.patch.object(coremidi, "_set_dict_prop", side_effect=lambda e, k, v: writes.append(v) or 0):
|
||||
self.assertEqual(coremidi.connect_peer("NA Ingest", "SuperRack-LiveBox", "10.1.13.140:5004",
|
||||
settle=lambda s: None), "kicked")
|
||||
self.assertEqual(coremidi.connect_peer("NA Ingest", "Lighting PC", "10.1.10.206:5004"), "already")
|
||||
self.assertEqual([[p["name"] for p in w["peers"]] for w in writes],
|
||||
[["Lighting PC"], ["Lighting PC", "SuperRack-LiveBox"]]) # dropped, then added back
|
||||
|
||||
def test_an_off_pc_is_woken(self):
|
||||
from unittest import mock
|
||||
woke = []
|
||||
|
||||
Reference in New Issue
Block a user