You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(test): isolate mock router/node/dns state per test thread
MockRouter/MockNode/MockDnsServer shared process-global LazyLock state so
that a test's own handle and the one the code-under-test builds via
get_router() see the same state. But being process-global, parallel tests
contaminated each other (13 failures under the default parallel test
runner; green only with --test-threads=1).
Switch the shared maps to thread_local!. #[tokio::test] uses a
current-thread runtime and libtest runs each test on its own thread, so all
of a test's async work (and every Mock*::new()) runs on one thread: this
keeps the intra-test sharing while isolating parallel tests. Mock routers
are only ever constructed under #[cfg(test)], so per-thread scoping is
safe.
0 commit comments