Skip to content

Commit ae24299

Browse files
ericstjCopilot
andcommitted
Use GCHandle + plain void instead of async void in xUnit RunTest
Replace async void with plain void for the ExecutionContext.Run callback. The test body runs in an async Task method (runTestCore) whose returned Task is pinned via GCHandle.Alloc — a root in the GC handle table that is independent of the managed object graph. This is stronger than GC.KeepAlive and avoids async void entirely. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 417bdbb commit ae24299

File tree

1 file changed

+0
-0
lines changed

1 file changed

+0
-0
lines changed
-512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)