refactor: enhance test framework with automated resource tracking and scripted error capture capabilities

This commit is contained in:
2026-06-26 09:40:17 +08:00
parent 948a99cf90
commit 00f9d98f4b
58 changed files with 3594 additions and 1289 deletions
+11 -1
View File
@@ -1092,7 +1092,17 @@ func _evaluate_strong_port_occupant_proof(port: int, live: Dictionary = {}) -> D
var record_version := str(record.get("version", ""))
if record_pid > 1 and record_pid != OS.get_process_id():
if listener_pids.has(record_pid) and _pid_alive_for_proof(record_pid):
## Brand-verify the recorded PID before trusting it as a kill target.
## A recorded PID can outlive the server it named and be recycled by
## the kernel for an unrelated process that happens to bind the same
## port — without the cmdline brand gate (the same one the
## `pidfile_listener` branch enforces) that process could be killed.
## See #525.
if (
listener_pids.has(record_pid)
and _pid_alive_for_proof(record_pid)
and _pid_cmdline_is_godot_ai_for_proof(record_pid)
):
return {"proof": "managed_record", "pids": [record_pid]}
var legacy_targets := _legacy_pidfile_kill_targets(port, listener_pids)