Commit Graph
579 Commits
Author SHA1 Message Date
Stephen Toub 69f5fdff1c Serialize Dns async-over-sync requests for the same host (#49171)
* Serialize Dns async-over-sync requests for the same host

* Update src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs
2021-03-05 16:15:30 -05:00
Stephen Toub 4b723a5501 Add current-dns-lookups counter to System.Net.NameResolution (#49146) 2021-03-04 22:32:41 -05:00
Günther Foidl d3987b62ab Revert async nameresolution on Unix (#48666)
* Revert "NameResolutionPal.Unix: fixed loss of address family information in async lookup (#47171)"

This reverts commit 2f2593177d.

* Revert "NameResolutionPal.Unix enabled async name resolution (#34633)"

This reverts commit f4ae905942.

* Fixed unreachable code bug

SupportsGetAddrInfoAsync is a constant on *nix. Tests check if it's supported and return if not, so unreachable code was created on *nix.

* Restored warning CS0162
2021-03-03 21:02:16 -05:00
Viktor Hofer cbc05c4775 Disable failing DNS tests on SLES (#48759)
* Disable failing DNS tests on Linux

As there's currently no infrastructure to disable just for SLES,
disabling for its parent, which is Linux.

* Disable failing dns tests for sles only
2021-02-25 23:15:40 +01:00
Stephen Toub dc7655540d Enable async-over-sync Task in Dns to be canceled (#48684)
While we can't currently cancel the synchronous call, we can at least cancel the Task prior to its being executed.
2021-02-24 09:54:17 -05:00
Juan Hoyos 02af68edfc Disable TryGetAddrInfo_ExternalHost on android (#47594) 2021-01-28 20:53:30 +00:00
Tomas Weinfurt 223cb5af39 Support Async DNS lookup on older Windows from impersonificated context (#47435)
* test WindowsIdentityImpersonatedTests runs

* fix win8

* add test variant

* final cleanup
2021-01-26 20:58:05 -08:00
Günther Foidl 1f493b3957 NameResolution-Tests: enable GetHostEntryAsync_InvalidHost_LogsError on Windows (#47034)
* Enable GetHostEntryAsync_InvalidHost_LogsError on Windows too

* Use WaitForErrorEventAsync instead of a naive Task.Delay

Cf. https://github.com/dotnet/runtime/pull/47034#discussion_r558728557
2021-01-21 17:31:41 -05:00
Jan Kotas ce4423ab00 Skip NativeLibrary abstraction for Windows-specific system libraries (#47013) 2021-01-14 20:48:05 -08:00
Günther FoidlandVladimir Sadov f4ae905942 NameResolutionPal.Unix enabled async name resolution (#34633)
* Native implementation

* Native tests

* Managed implementation

* Managed tests

* Revert Interop.GetHostName change -- it's needed at other places too

So this change was a bad idea ;-)

* Fixed builds failures due to "unused parameter"

* Native: move struct addrinfo hint from stack-alloc to heap-alloc

Before I didn't last the async operation as it was on the stack. Now it's part of the GetAddrInfoAsyncState which gets heap allocted, so it last.
I'm not sure if addrinfo needs to last the async operation, as the native tests pass either way. This change makes it more correct, nevertheless.

* PR feedback

* Fixed leak in tests.c according to valgrind's run

* Fixed bug due to marshalled string argument

* More managed PalTests

* Revert "Native tests"

This reverts commit 8c955bc4bd1d0dbe4b2823f4327ad52bf9856fd7 and d7cb2be7eb3ec09f27a537c89341fb63e176e0bc.

* Handle the case of HostName="" and tests for this

* Use flexible array member to hold the address in struct state

Cf. https://github.com/dotnet/runtime/pull/34633#discussion_r406447963

* Nits in native layer

Cf. https://github.com/dotnet/runtime/pull/34633#discussion_r406494734

* Fixed native merge conflict + added AddressFamily-handling

* Fixed managed merge conflicts + added AddressFamily-handling

* Updated NameResolutionPalTests for AddressFamily

* Removed EnsureSocketsAreInitialized

On Unix this was a nop anyway, https://github.com/dotnet/runtime/pull/43284 removed it from Windows.

* Fixed bug at native side

Seems like "hint" must last the async operation, so stack-only won't do it.
Tests will crash with
```
The active test run was aborted. Reason: Test host process crashed : .../runtime/src/libraries/Native/Unix/System.Native/pal_networking.c (315): error -7: Unknown AddrInfo error flag. Unknown error -7 (0 failed)
```

If put into the heap, it succeeds.

* Refactor setting of the address family into TrySetAddressFamily

* Fixed unused parameter warning / failure

* Little cleanup

* Fixed (unrelated) test failures

Cf. https://github.com/dotnet/runtime/pull/34633#issuecomment-746377633

* Made LoggingTest async instead of GetAwaiter().GetResult()

* Use function pointer

* Use OperatinngSystem instead of RuntimeInformation in tests

* PR Feedback for CMake

* Update src/libraries/Native/Unix/System.Native/extra_libs.cmake

Co-authored-by: Günther Foidl <[email protected]>

* Revert "Update src/libraries/Native/Unix/System.Native/extra_libs.cmake"

This reverts commit fa9c6f90b7ef5033e3c30a46dfe34dc47d5ef91e.

* Another to build single file host

Based on https://github.com/dotnet/runtime/pull/34633#issuecomment-756045320

* Test for !Windows instead excluding several Unix-flavors

Cf. https://github.com/dotnet/runtime/pull/34633#issuecomment-760205332

Co-authored-by: Vladimir Sadov <[email protected]>
2021-01-14 15:01:11 -08:00
1655959699 fallback to GetAddrInfoW if GetAddrInfoExW fails (#45816)
* fallback to GetAddrInfoW if GetAddrInfoExW fails

* Update src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs

Co-authored-by: Cory Nelson <[email protected]>

* Update src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionPal.Windows.cs

Co-authored-by: Jan Kotas <[email protected]>

* feedback from review

* update fakes

* attempt to fix telemetry

* remofe forced telemetry

* fix spelling

* improve duration precision

* task refactor

* update fakes again

* rename function

Co-authored-by: Cory Nelson <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
2021-01-11 22:15:51 -08:00
Anirudh AgnihotryandViktor Hofer 659c5fbc7f disable restore in vs for projects targeting platform specific old frameworks (#44932)
* disable vs restore in vs for projects targeting platform specific older frameworks

* Add infra to auto-update solution files for restore

* Add NuGet.config files for solutions affected by restore issue

Co-authored-by: Viktor Hofer <[email protected]>
2020-12-02 23:18:52 +01:00
Stephen Toub 8bbbf6d673 Delete NetEventSource.IsEnabled (#44901)
* Delete NetEventSource.IsEnabled

These were all meant to be changed to NetEventSource.Log.IsEnabled(), and there are almost 900 occurrences of that pattern.  But there are still 9 stragglers, and the method itself.  Deleting the method and fixing the call sites.

* Fix uses in NetEventSource itself
2020-11-19 14:50:16 -05:00
Viktor Hofer ed295782bf Add workflow to update solution files with SlnGen and update them initially (#44703)
* Add slngen infra

* Update all solution files
2020-11-17 18:23:30 +01:00
Stephen ToubandJeremy Barton 5943f09f00 Replace Tuples with ValueTuples (#44712)
Some help to remove allocation, some just help to avoid pulling in Tuple and likely increasing build size.

* Update src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs

Co-authored-by: Jeremy Barton <[email protected]>
2020-11-16 22:28:01 -08:00
Anirudh Agnihotry b37f10a504 Changing Windows_NT -> Windows for enabling TargetPlatformMoniker feature of the sdk for platform specific tfms. (#43651)
* eng change

* coreclr change

* libraries change

* tests change

* installer & mono change

* py files changed

* .md change

* .yml change

* remove redundant targetos property

* Windows_NT -> windows after ninja change

* fixing runtime build failure
2020-11-02 14:25:58 -08:00
Levi Broderick 04c5644477 Use BinaryPrimitives where possible (#43474) 2020-10-29 21:30:07 -07:00
Cory Nelson b0be1ab8c7 Add cancellable and AddressFamily-specific name resolution. (#33420)
Add AddressFamily-specific name resolution and cancellation support for Windows. Resolves #939
2020-10-26 11:06:10 -07:00
Jan KotasandStephen Toub c80e10046f Simplify winsock initialization (#43284)
* Initialize winsock directly

* Delete test that is not relevant anymore

* Add tests for methods the require initialized winsock 

Co-authored-by: Stephen Toub <[email protected]>
2020-10-12 21:25:37 -07:00
Stephen Toub faf91e0a74 Address outstanding issues with System.Net MatchingRefApiCompatBaselines (#43230) 2020-10-09 17:18:36 -04:00
Miha Zupan e17d818e25 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
2020-09-25 10:16:18 +02:00
Mitchell HwangandMitchell Hwang 2b43b860eb [wasm] Mark System.Net.NameResolution Unsupported at assembly level (#41985)
Co-authored-by: Mitchell Hwang <[email protected]>
2020-09-08 19:24:33 -04:00
Jan Kotas 1789775d07 Update license headers (#41783) 2020-09-03 08:43:29 +00:00
Anirudh Agnihotry d0efddd932 Use Roslyn apis to generate Platform Not Supported Assemblies (#40296)
* fixes on the runtime side

* address feedback

* update arcade version

* merge conflicts

* update the version
2020-08-17 17:01:27 -07:00
Marie Píchová ba7c518a49 Renamed EventSources "Microsoft-"->"Private.InternalDiagnostics.". 2020-08-17 13:10:32 +02:00
Miha Zupan 5e220a614d Improve error details on DNS Telemetry test failure (#40665) 2020-08-11 18:47:36 +02:00
Adam Sitnik efafca9bd8 use new OperatingSystem APIs in test projects that target NetCoreAppCurrent only (#40522)
* use new OperatingSystem APIs in test projects that target NetCoreAppCurrent only

* use `||` instead of `|`
2020-08-10 17:50:42 +02:00
Viktor Hofer 809a06f451 Remove depprojs in favor of PackageReferences (#35606)
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items.
- Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support.
- Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries.
- Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime.
- Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore.
- Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims.
- Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases.
- Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references.
- Remove implicit assembly references (ie for .NETFramework, mscorlib)
- Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default.
- Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations.
- Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences.
- Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms)
- Revert "fix clean (#33758)"
2020-07-23 17:20:26 +02:00
Miha Zupan 2b94d13664 Update license header in NameResolutionTelemetry (#39711) 2020-07-21 17:52:18 +02:00
Alexander Köplinger 6998f4c575 Unify resource strings used for Browser PNSE (#39637)
We sometimes used `... is not supported on Browser.` and elsewhere `... is not supported on this platform.`

Standardize on the latter one as it can potentially be reused for other targets.
2020-07-20 21:22:55 +02:00
Miha Zupan 940c49e958 Add telemetry to System.Net.NameResolution (#38409)
* Add telemetry to System.Net.NameResolution

* Rename hostName to hostNameOrAddress

* Use constants for event IDs

* Address PR feedback

* Reduce overhead when only the counter is needed

* Make NameResolution Telemetry an activity

* Remove redundant check

* Fix indentation

* Check IsEnabled before AfterResolution to help linker

* Add Telemetry tests

* Throws => ThrowsAny
2020-07-17 21:05:41 +02:00
Alexander Köplinger cd4157f902 WASM: Add PNSE for System.Net.NameResolution and disable tests (#39219)
We only support `Dns.GetHostName()` since that didn't throw in the older mono WebAssembly release and can be redirected to `Environment.MachineName`.
2020-07-14 11:59:01 +02:00
Stephen Toub b39c698c62 Delete NetEventSource.Enter/Exit events (#38874)
They're super verbose, very inconsistent, costly, and not helpful (they appear to be trying to provide tracing of the full flow of calls, but they fail to do even that).
2020-07-10 09:31:21 -04:00
Eric Erhardt 98eee0587d Trim NetEventSource when EventSource.IsSupported is false (#38828)
* Trim NetEventSource when EventSource.IsSupported is false

Follow up to #38129. NetEventSource code was still left in even when EventSource.IsSupported is false, since all the usages of NetEventSource are keying off its own static property: NetEventSource.IsEnabled.

Remove NetEventSource.IsEnabled so the linker can trim NetEventSource code when EventSource.IsSupported is false.

* Remove HttpTelemetry.IsEnabled static property so the linker can trim EventSource code when EventSource.IsSupported is false.

* Fix fake NetEventSource to match what is in the product.
2020-07-09 14:12:44 -04:00
Stephen Toub 6072e4d3a7 Update license headers (#38793) 2020-07-08 09:23:11 -04:00
Anirudh Agnihotry 5ce04ccc9a Make browser peer for windows_nt and unix (#37944)
Fixes https://github.com/dotnet/runtime/issues/38559
2020-07-08 12:59:37 +02:00
9ccfc40ec9 [libraries] Properly skip thread failing WASM tests (#38089)
Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
2020-06-20 01:49:29 +02:00
Mitchell HwangandMitchell Hwang 480c49b241 [libraries] Add ConditionalFact to wasm failing tests (#37822)
* [libraries] Add IsThreadingSupported

* [libraries] Add IsThreadingSupported attribute to failing wasm tests

* [libraries] Add IsObdcNotAvailableAndThreadingSupported property to DependencyCheckTest

* [libraries] Include system namespace in RedactedLogValueIntegrationTest and fix DependencyCheckTest ConditionalFact

* [libraries] Revert System.Console IsThreadingSupported changes

* [libraries] Remove IsThreadingSupported attribute from EncodingCodePages

Co-authored-by: Mitchell Hwang <[email protected]>
2020-06-17 13:48:00 -04:00
Stephen Toub c7a246c000 Delete DebugThreadTracking from networking code (#36549)
The System.Net.* libs in dotnet/runtime inherited this from .NET Framework.  To my knowledge it's not once helped flag any issues in dotnet/runtime, it's only built into debug builds, it's become very inconsistent as the code base has evolved, and it's just cluttering stuff up.  So, goodbye.
2020-05-15 17:47:15 -04:00
Marcus Turewicz 890fab0a64 Use attribute Link syntax for Common files (#35436)
* Change <Link>...</Link> to Link="..."

* Format existing Link="..."
2020-04-25 05:26:50 -07:00
Alexander Nikolaev 78127522e6 Enable DnsGetHostEntry_LocalHost_ReturnsFqdnAndLoopbackIPs (#35399)
Test is enabled because the failures were caused by Helix infra issue (a misconfigured agent) which was fixed a couple of days ago.

Fixes #34317
2020-04-24 18:21:19 +02:00
Viktor Hofer d0dc66bc0b Rename CoreFx.Private.TestUtilities and reference it in slns (#34656)
* Rename CoreFx.Private.TestUtilities to TestUtilities

* Add TestUtilities reference to slns
2020-04-08 01:26:53 +02:00
Karel Zikmund d818d33294 Disable test DnsGetHostEntry_LocalHost_ReturnsFqdnAndLoopbackIPs (#34527) 2020-04-04 14:17:51 -07:00
IlyaandStephen Toub b59225da89 Annotate System.Net.Primitives for nullable (#31794)
* Annotate System.Net.Primitives for nullable

* Fix build breaks in other libraries due to new annotations

Co-authored-by: Stephen Toub <[email protected]>
2020-02-21 17:59:19 +00:00
Santiago Fernandez Madero 110282c71b Update all issues in source code to point to runtime (#32349) 2020-02-18 15:49:23 -08:00
Levi Broderick 0d08b0232d API review URL should be HTTPS, not HTTP (#32281) 2020-02-14 08:07:46 -08:00
Stephen Toub 1dca86fe0e Annotate System.Net.NameResolution for nullable reference types (#32011) 2020-02-10 08:04:55 -08:00
Anirudh AgnihotryandViktor Hofer c0e876f165 Addressing Minor Cleanup (#31845)
* addressing viktor feedback

* Update System.Reflection.Emit.ILGeneration.csproj

* Update tests.proj

* Update System.Reflection.Emit.Lightweight.csproj

* Update System.Xml.XPath.XDocument.Tests.csproj

* fixing emit projects, making them similar before config change

Co-authored-by: Viktor Hofer <[email protected]>
2020-02-06 19:08:07 -08:00
Anirudh Agnihotry 725968c3c5 New Configuration System (#1787)
* libraries -restore for vertical build without test restore

* Automatic test change and regex to remove the addition of an extra line at eof

* manual test restore fixed (restore completely done for vertical build)

* build native done

* Automatic ref change and regex to remove the last line

* manual reference assebly change and generated shims build

* automatic src change and regex

* native bin place and src build manual change

* apicompat and pretest.csproj done

* fixing the package build

* fixing all config

* packaging and feedback

* adding back placeholder configuration

* fixing the shims

* delete configuration.props

* making the build work in master

* Test Change

* fixing the packageing, test restore replacing TargetFramework -> OriginalTargetFramework

* delete test configuraiton.props, trailing semicolon and use targetFramework

* reverting the package change

* enable apicompat and fixing configurationGroup for individual projects

* fixing the api compat

* making ilproj work

* adding the outerBuildTest

* adding the arcade package version

* fixing the merge conflicts

* minor changes

* adding additional configs and setting the runtimeOS

* making the  vs stuff work

* removing the target Group to fix the apicompat

* fixing the linux build and some minor changes

* making additionalBuildTargetFramework LOcalProperty

* fixing the allConfigurations build

* fixing the netfx build

* fixing package Testing and restore

* Missing  TargetFrameworks tag

* making the VSdesgin stuff work

* Remove OriginalFramework Entirely

* some minor pr feedback

* RemoveExtraSemicolon

* use boolean exclude flag

* fixing yml scripts to pass tests

* adding comments and some minor feedback

* moving packaging property to correct plave

* fixing the build for web assembly

* Fixing the live ci build

* Fixing the live build for shims

* fixing the tests

* fixing the packaging and enterprise linux

* fixing  package sizes

* Fix the targetFramework

* updating the targetFramework sdl

* removing the buildOS and be able to use OSGroup as done in the old system

* Fixing the osgroup stuff for send to helix task

* Fix OSX failures

* Fixing the osx build

* uploading tmp folder to artifacts

* running restore for runtime.deproj correctly
2020-02-06 05:24:08 +00:00
Jan Kotas 099a512445 Merging small assemblies (part 1/N) (#2189)
* Delete unnecessary ClsCompliant

* Merge System.Diagnostics.Tools\src into CoreLib

* Merge System.Security.Pricipal\src into CoreLib

* Delete System.IO.UnmanagedMemoryStream\ref\System.IO.UnmanagedMemoryStream.cs

* Delete System.Reflection\ref\System.Reflection.cs

* Delete  System.Threading.Timer\src\ApiCompatBaseline.uapaot.txt

* Delete System.Buffers\src\Resources\Strings.resx

* Merge System.Buffers\ref into System.Runtime

* Merge System.Diagnostics.Debug\ref into System.Runtime

* Delete *\MatchingRefApiCompatBaseline.txt

* Merge System.Diagnostics.Tools into System.Runtime\ref

* Merge System.Resources.ResourceManager into System.Runtime\ref

* Cleanup System.IO.* project references

* Cleanup System.Reflection project references

* Cleanup System.Runtime.Handles project references

* Merge System.Threading.Thread\src into CoreLib

* Merge System.Threading.Timer\ref into System.Runtime

* Merge System.Threading.Tasks\ref into System.Runtime
2020-01-29 10:02:22 -08:00