checkNotUnderTestDispatcher
Emits a warning (or throws, when strict is true) if scope contains a kotlinx.coroutines.test.TestDispatcher.
Types that own a real-clock delay() loop (e.g. an election timer, an anti-entropy ticker) should call this at construction time. Under virtual time those delays never advance automatically, causing tests to deadlock silently rather than failing with a clear message. Calling this guard surfaces the misuse immediately, at the moment the type is constructed.
TestDispatcher is internal in the coroutines library, so detection is class-name-based: "TestDispatcher" in the qualified name, or the package prefix kotlinx.coroutines.test..
Parameters
The scope to inspect.
Short name of the calling type, used in the diagnostic message.
The recommended test substitute (e.g. "FakeRaftNode").
When true, throw IllegalStateException instead of printing.
When true, the caller has explicitly validated that a TestDispatcher is appropriate (e.g. an UnconfinedTestDispatcher where real-clock delay() fires normally, or a test that advances virtual time manually). Suppresses both the warning and the strict throw. Has no effect outside a test dispatcher context.