Fix System.Net.Sockets telemetry (#42188)
authorMiha Zupan <mihazupan.zupan1@gmail.com>
Fri, 25 Sep 2020 08:16:18 +0000 (10:16 +0200)
committerGitHub <noreply@github.com>
Fri, 25 Sep 2020 08:16:18 +0000 (10:16 +0200)
commite17d818e25567d7fa9525ae5d32e2b8d2483ae96
tree9e4e4c8f2afe846a1d4b26ae199b9ffa45c54f9b
parent5130c6d71818e5ee336480f46059780051daaa79
Fix System.Net.Sockets telemetry (#42188)

* Correct NameResolutionTelemetry logic

Taken from c4c9a2f99b7e339388199086d3014041abccc21e

* Enable listening to multiple sources with TestEventListener

* Workaround EventWrittenEventArgs bug when the EventArgs are stored

Workaround https://github.com/dotnet/runtime/issues/42128

* Correct System.Net.Sockets Telemetry

* Avoid using value tuple in TestEventListener

* Remove unnecessary argument to OnCompletedInternal

* Remove redundant Telemetry.IsEnabled check

* Log Connect/Accept start before the initial context capture

* Use SocketHelperBase in Accept tests

* Avoid duplicate events for BeginConnect without ConnextEx support

* Enable Sync Socket tests

* Revert unrelated SocketPal change

* Log the correct ErrorCode in case of socket disposal

* Add more info on TelemetryTest timeout

* Add PlatformSpecific attribute to ConnectFailure test

* Add missing BeginConnect AfterConnect call on sync failure

* Add comment around GetHelperBase

* Correct WaitForEventCountersAsync helper

* Assert against SocketError.TimedOut in ConnectFailed test

* Add EndConnect comment

* Log Failure around sync SocketPal exceptions

* Don't assert that the exception message is empty

* Dispose socket in a different Thread

* Disable Telemetry failure tests for Sync on RedHat7

* Use more descriptive names in MemberData generation

* Avoid using reflection for #42128 workaround

* Remove ConnectCanceled event
src/libraries/Common/tests/System/Diagnostics/Tracing/TestEventListener.cs
src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketsTelemetry.cs
src/libraries/System.Net.Sockets/tests/FunctionalTests/TelemetryTest.cs