feat(daemon): D10 carriers + E16 ops RPCs + stress test + virtual fab
tests / build-and-test (push) Successful in 2m59s
tests / thread-sanitizer (push) Successful in 3m36s
tests / tshark-dissector (push) Successful in 2m25s
tests / secs4j-interop (push) Successful in 59s
tests / python-interop (push) Successful in 3m20s
tests / libfuzzer (push) Successful in 3m40s
tests / build-and-test (push) Successful in 2m59s
tests / thread-sanitizer (push) Successful in 3m36s
tests / tshark-dissector (push) Successful in 2m25s
tests / secs4j-interop (push) Successful in 59s
tests / python-interop (push) Successful in 3m20s
tests / libfuzzer (push) Successful in 3m40s
Completes the daemon's GEM300 surface and adds two new test tiers. D10 — E87 carriers: CarrierStore gains the HandlerSlot observer pattern (add_id/slot_map/access_handler). The daemon's id-observer forwards host S3F17 decisions onto the Subscribe stream as CarrierAction (PROCEED on a Confirmed transition, CANCEL on CancelCarrier); ReportCarrier drives the flow tool-side: WAITING creates the carrier + records the slot map, IN_ACCESS/COMPLETE advance the access FSM (INVALID_OBJECT on unknown, CANNOT_DO_NOW on an illegal transition). E16 — operations RPCs: Describe (full name inventory: variables/events/ alarms/commands/constants + device header), FlushSpool (purge or drain), SendTerminalMessage (S10F1 tool->host, honest CANNOT_DO_NOW when no host and stream 10 isn't spoolable). Stream responsiveness: Subscribe/WatchHealth poll at 100ms (was 500ms) so a cancelled stream frees its sync-server worker thread promptly — this was found by the new stress test, which hung under Subscribe churn at 500ms. Tests: - A randomized concurrent RPC stress case: 4 threads x 250 seeded ops (set/get/fire/alarm/control-state/describe + Subscribe churn), asserts no failed RPC and a still-responsive engine afterward; prints its seed; a strong TSan target. - A virtual fab (interop/virtual_fab.py + the `fab` compose service / tools/spawn_fab.sh): N daemons, each with a secsgem-py host AND a secsgem_client tool, driven by seeded random traffic with end-to-end invariant checks (set/get round-trips, event->S6F11 and alarm->S5F1 delivery, command->tool->completion). Verified green at N=3 (~150 ops/eq, all commands round-tripped, 0 violations). Wired into run_interop.sh (now 13 steps). Also fixes the CI break from the previous commit: the Python-client lane's test_values.py step lacked PYTHONPATH=clients/python (now step-level env). Two bugs found and fixed while building this, both mine from this batch: 1. carrier test hung on a CancelCarrier of a still-NotConfirmed carrier — a self-transition the FSM doesn't signal, so the observer never fired and the stream Read blocked forever. Fixed to cancel a Confirmed carrier; the NotConfirmed edge is documented as a known E87 limitation. 2. the 500ms stream poll above. Daemon suite 7 cases / 214 assertions; core 475 / 3097; virtual fab green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -19,6 +19,7 @@
|
||||
# pyclient published secsgem-client package vs secs_gemd (13 checks)
|
||||
# spool spool persistence across a server restart
|
||||
# daemon-ops unix-socket gRPC + Prometheus gauges + graceful SIGTERM
|
||||
# fab randomized virtual fab: FAB_N daemons x (host + tool) actors
|
||||
# tshark Wireshark HSMS dissector on a live capture
|
||||
# secs4j secs4java8 Java host vs C++ secs_server (55 checks)
|
||||
#
|
||||
@@ -37,7 +38,7 @@ record() { # record <name> <exit-code>
|
||||
|
||||
compose() { docker compose "$@"; }
|
||||
|
||||
stop_services() { compose stop server gemd server-spool >/dev/null 2>&1 || true; }
|
||||
stop_services() { compose stop server gemd server-spool fab >/dev/null 2>&1 || true; }
|
||||
trap stop_services EXIT
|
||||
|
||||
# ---- build -----------------------------------------------------------------
|
||||
@@ -126,6 +127,15 @@ note "daemon-ops: unix socket, Prometheus gauges, SIGTERM drains cleanly"
|
||||
compose run --rm builder bash tools/check_daemon_ops.sh
|
||||
record daemon-ops $?
|
||||
|
||||
# ---- randomized virtual fab ----------------------------------------------------
|
||||
note "fab: ${FAB_N:-3} equipment x (secsgem-py host + secsgem-client tool), seeded random traffic"
|
||||
compose up -d --no-deps fab
|
||||
sleep 3
|
||||
compose run --rm --no-deps -e PYTHONPATH=/app/clients/python interop \
|
||||
python3 virtual_fab.py --host fab --n "${FAB_N:-3}" --seconds "${FAB_SECONDS:-20}"
|
||||
record fab $?
|
||||
compose stop fab >/dev/null 2>&1
|
||||
|
||||
# ---- Wireshark dissector ------------------------------------------------------
|
||||
note "tshark: Wireshark HSMS dissector"
|
||||
compose run --rm builder bash interop/tshark_validate.sh
|
||||
|
||||
Reference in New Issue
Block a user