Skip to content

Commit

Permalink
[testing] Update TraceEvent package version and bypass corner case in…
Browse files Browse the repository at this point in the history
… EventPipe (#1794)

* Update TraceEvent package version

* Workaround for deadlock in EventPipe
* Remove this change once the fix has be made

* Force the event source to be created
  • Loading branch information
John Salem authored and safern committed Jan 18, 2020
1 parent c4bddfb commit 522e9d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Tests/infrastructure dependency versions. -->
<PropertyGroup>
<XunitPerformanceApiPackageVersion>1.0.0-beta-build0015</XunitPerformanceApiPackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.43</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.49</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
<MicrosoftDiagnosticsToolsRuntimeClientVersion>1.0.4-preview6.19326.1</MicrosoftDiagnosticsToolsRuntimeClientVersion>
<CommandLineParserVersion>2.2.0</CommandLineParserVersion>

Expand Down
13 changes: 13 additions & 0 deletions src/coreclr/tests/src/tracing/eventpipe/common/IpcTraceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tools.RuntimeClient;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -173,6 +174,18 @@ private int Fail(string message = "")

private int Validate()
{
// FIXME: This is a bandaid fix for a deadlock in EventPipeEventSource caused by
// the lazy caching in the Regex library. The caching creates a ConcurrentDictionary
// and because it is the first one in the process, it creates an EventSource which
// results in a deadlock over a lock in EventPipe. These lines should be removed once the
// underlying issue is fixed by forcing these events to try to be written _before_ we shutdown.
//
// see: https://github.com/dotnet/runtime/pull/1794 for details on the issue
//
var emptyConcurrentDictionary = new ConcurrentDictionary<string, string>();
emptyConcurrentDictionary["foo"] = "bar";
var __count = emptyConcurrentDictionary.Count;

var isClean = EnsureCleanEnvironment();
if (!isClean)
return -1;
Expand Down

0 comments on commit 522e9d9

Please sign in to comment.