-
Notifications
You must be signed in to change notification settings - Fork 293
Description
TelemetryClient.Track(ITelemetry telemetry) invokes RichPayloadEventSource.Log.Process(telemetry) after completing the telemetry chain. That method performs checks such as:
if (!this.EventSourceInternal.IsEnabled(EventLevel.Verbose, Keywords.Metrics)) { . . . }.
When running unit tests in VS, that call to EventSourceInternal.IsEnabled(EventLevel.Verbose, Keywords.Metrics) always returns true when running under debugger. However, when running without a debugger, that call behaves inconsistently: When executing a single unit test, it always returns false. When running multiple unit tests in VS, that method sometimes returns true and sometimes false. As a results, Sanitize() is sometimes invoked for the telemetry item, and sometimes not. This breaks tests that rely on a specific state of the telemetry item (either sanitized or not). It will also affect any telemetry items potentially stored in a channel cache.
Please make this behavior predictable.
Thank you.