fix: review fixes for step 4a

- e2e: the heap check uses a socket slot now, so it waits for the device
  to free it, and test_every_client_reconnecting_at_once closes its
  clients before the check runs.
- Comments and docs that still named removed things (the /controller read,
  the event buffer, memStatus, SocketEmitter, ModelSnapshot).
- ESPNetwork::emitSockets is emitStatus: one socket, and it sends the status.
- Unused includes, whitespace-only lines left by the toJSON removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-27 22:11:54 +01:00
parent 2a954aa158
commit cfa298f053
13 changed files with 26 additions and 23 deletions

View file

@ -234,6 +234,9 @@ def heap(host, token=None):
_, frames, _ = run_sync(c, schema)
finally:
c.close()
# The device frees the slot when it sees the disconnect; the caller
# may need every slot.
time.sleep(0.5)
key = schema.keys["status"]
status = schema.expand(next(f["d"][key] for f in frames if key in f["d"]))
return {"free": status["freeHeap"], "min": status["minHeap"], "max": status["maxHeap"], "uptime": status["uptime"]}

View file

@ -47,7 +47,9 @@ def all_slots_free(host, token):
pytest.skip("%u socket slot(s) in use, likely by the web UI: close its tabs" % taken)
def test_every_client_reconnecting_at_once(connect, schema, watch_heap, all_slots_free):
# watch_heap comes before connect so pytest tears connect down first: the
# heap check after the test needs a free slot.
def test_every_client_reconnecting_at_once(watch_heap, all_slots_free, connect, schema):
clients = [connect() for _ in range(MAX_CLIENTS)]
errors = []

View file

@ -232,7 +232,7 @@ static void test_emitAllowed_refuses_another_task() {
TEST_ASSERT_FALSE(emitAllowed(&wifiEventTask, &loopTask));
}
static void test_emitAllowed_before_the_owner_is_known() {
// setup() before SocketEmitter::begin(), which is loop()'s task anyway.
// setup() before ProtoSocket::begin(), which is loop()'s task anyway.
TEST_ASSERT_TRUE(emitAllowed(&loopTask, nullptr));
}