Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualizing execution history docs #2885

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions docs/running-tests-in-parallel.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>Running Tests in Parallel</h1>
<li><a href="#parallelism-in-test-frameworks">Parallelism in Test Frameworks</a></li>
<li><a href="#parallelism-in-runners">Parallelism in Runners</a></li>
<li><a href="#parallelism-via-configuration">Parallelism via Configuration</a></li>
<li><a href="#visualizing-execution-history">Visualizing execution history</a></li>
</ul>

<h2 id="background">Background</h2>
Expand Down Expand Up @@ -397,6 +398,43 @@ <h2 id="parallelism-via-configuration">Parallelism via Configuration</h2>
on how to set up configuration files and change parallelism settings.
</p>

<h2 id="visualizing-execution-history">Visualizing execution history</h2>

<p>
Beginning with v2 version <code>x.x.x</code> and v3 version <code>x.x.x</code>,
xUnit.net is capable of emitting <a href="https://learn.microsoft.com/dotnet/core/diagnostics/eventsource-getting-started">EventSource</a>
events that describe provide events when a test has started and finished. These events can be captured and visualized by a profiler.
One of such profiler is <a href="https://learn.microsoft.com/visualstudio/profiling/concurrency-visualizer">Concurrency Visualizer</a> (a free plugin for Visual Studio).
Concurrency Visualizer can be used to locate performance bottlenecks, CPU under-utilization, thread contention
and other parallelization issues.
</p>

<p>
Concurrency Visualizer needs to enable the xUnit.net event source. This can be done by selecting
<em>Analyze -> Concurrency Visualizer -> Advanced Settings</em> in Visual Studio.
</p>

<p><a href="/images/concurrency-visualiser/vs_menu.png"><img class="border" src="/images/concurrency-visualiser/vs_menu.png" width="658" /></a></p>

<p>
After clicking the add button, <code>xUnit.TestEventSource</code> needs to be specified as <em>Name</em>
and <code>ae399e80-45fc-4219-aacc-b73a458ad7e1</code> as the <em>Provider GUID</em>.
</p>

<p><a href="/images/concurrency-visualiser/settings.png"><img class="border" src="/images/concurrency-visualiser/settings.png" width="724" /></a></p>

<p>
Following the steps described above is required only once and should allow for visualizing the parallel execution history of the given test project.
</p>

<p><a href="/images/concurrency-visualiser/cores.png"><img class="border" src="/images/concurrency-visualiser/cores.png" width="1021" /></a></p>

<p>
Test display names will be shown in the <em>Threads</em> tab:
</p>

<p><a href="/images/concurrency-visualiser/threads.png"><img class="border" src="/images/concurrency-visualiser/threads.png" width="1021" /></a></p>

<section class="related-topics">Related topics:</section>
<ul>
<li><a href="shared-context.html">Shared Context between Tests</a></li>
Expand Down
Binary file added images/concurrency-visualiser/cores.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/concurrency-visualiser/settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/concurrency-visualiser/threads.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/concurrency-visualiser/vs_menu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.