@@ -7,12 +7,19 @@ defmodule Sentry.Test.Scope.Registry do
77 #
88 # * `{:sentry_test_scope, owner_pid} -> %Scope{}` in `:persistent_term` —
99 # one entry per active test scope, owns its overrides.
10- # * `:sentry_test_scope_allows` ETS table (named, public, set) —
11- # reverse index `{allowed_pid, owner_pid}` mapping each
12- # explicitly-routed pid back to the scope that claimed it.
13- # Owned by `Sentry.Test.Registry`. Direct ETS reads on the config
10+ # * `:sentry_test_pid_routing` ETS table (named, public, set) —
11+ # single merged routing table owned by `Sentry.Test.Registry`.
12+ # Rows are 3-tuples
13+ # `{allowed_pid, owner_pid_or_nil, processor_name_or_nil}`: the
14+ # owner field is the reverse index mapping each explicitly-routed
15+ # pid back to the scope that claimed it (read here via
16+ # `lookup_allow_owner/1`); the processor field routes buffered
17+ # events (logs, metrics) from that pid to a per-test
18+ # `Sentry.TelemetryProcessor`. Direct ETS reads on the config
1419 # read path; conflict-checked writes serialize through that
15- # GenServer for atomic check-and-insert.
20+ # GenServer for atomic check-and-insert. Owner exit is handled by
21+ # that GenServer's `:DOWN` monitor (routing-row prune +
22+ # `handle_owner_down/1`), not `ExUnit.Callbacks.on_exit/1`.
1623 # * `@counter_key -> :counters.t()` — atomic counter for cheap
1724 # "any active scopes?" short-circuits, so config reads in
1825 # production cost essentially nothing.
@@ -29,8 +36,11 @@ defmodule Sentry.Test.Scope.Registry do
2936 # GenServers started via `start_supervised/1`).
3037 # 3. by_allow — walk `[pid | ancestors]`; reverse-allow lookup
3138 # for each candidate (the pid was explicitly
32- # routed onto a scope via `allow/2` or
33- # auto-allowed in `Config.put/1`).
39+ # routed onto a scope via
40+ # `Sentry.Test.allow_sentry_reports/2` /
41+ # `Sentry.Test.Config.allow/2`, or auto-allowed in
42+ # `Sentry.Test.Config.put/1` — all of which claim
43+ # through `Sentry.Test.Registry.claim_allow/3`).
3444 #
3545 # Globally-supervised processes (`:logger`, `:logger_sup`,
3646 # `Sentry.Supervisor`) have no caller/ancestor link to any test and
0 commit comments