Long story short:
I have spent several hours trying to get a test run on SLES in order to repro #57929, no success so far, and it may take days to make progress, since I'm unfamiliar with SLES.
I recommend to bump the timeout values for now, and see if it helps with the issue. If not, we may invest into another round of investigation.
(hopefully) fixes#57929
* Socket: check connect result when non-blocking connect completes.
In addition to checking whether the socket is writable to know the
connect completed, also read SO_ERROR to know if the connect was
succesful before setting the Socket state to connected.
* Avoid EADDRNOTAVAIL on Windows/OSX by connecting to port 1 instead of 0.
* We don't expect InProgress result from reading SO_ERROR.
* Handle platform differences.
* Poll timeout is microseconds instead of milliseconds.
* PR feedback
* PR feedback
Fixes#57907
Intentionally left out `***CancellableTask` and `***SyncForceNonBlocking` to somewhat counterpart the increased execution time. I don't think we need all the cases for this particular test.
Fixes#47583. Resolves#52287, #54807 and similar issues, without changing customer application code.
Introduces an AppContext switch `System.Net.DisableIPv6` and environment variable `DOTNET_SYSTEM_NET_DISABLEIPV6` to emulate the lack of OS-level IPv6 support. This is useful to workaround dual-stack socket issues when the OS reports support of IPv6, but some other underlying infrastructure element (typically VPN) doesn't function well with IPv6 request.
For consistency, this switch also impacts NameResolution and Ping, not only Sockets.
* Sockets.tests: TcpReceiveSendGetsCanceledByDispose: remove Timeout.
This timeout is not needed and masks a more useful exception thrown
by the test.
* Add WaitAsync to timeout on all async operations
* Add missing timeout
* Socket: don't assign right endpoint until the connect is successful.
'Right endpoint' must match the address family of the Socket or
we can't serialize the LocalEndPoint and RemoteEndPoint.
When multiple connect attempts are made against a DualMode Socket with
both IPv4 and IPv6 addresses, a failed attempt must not set 'right
endpoint'.
* SocketTaskExtensionsTest.EnsureMethodsAreCallable: update expected exceptions
* PR feedback
* EnsureMethodsAreCallable: move ReceiveFromAsync before ConnectAsync to avoid wildcard bind on Windows that leads to a different exception
The timeout on this test is less than the accumulated delay on retries,
which causes the test to timeout on a RHEL7 system that has the kernel bug fixed.
* Fix empty byte[] bug in EventSource
* Add some non-zero data to byte[] tests
* Remove leftover usings from testing
* Return Array.Empty for empty byte[]
* Pass correct pointer to Marshal copy
In effort to assess the state of the iOS library tests, a number of tests will be skipped
Test suites that crash, hang, or have a significant number of failures (mostly 20+ failing unique test methods) are skipped on at the `tests.proj` level. Otherwise, `[ActiveIssue]` attributes have been attached to either the individual test methods that fail or the entire class if the whole test class fails. Any pre-existing `ActiveIssue` attribute associated with iOS had been reassessed to either remain or be closed.
A few test suites have been skipped because they fail with some form of `PlatformNotSupportedException`. `[SkipOnPlatform]` attributes are attached to the failing test methods.
All of the Issues can be tracked at https://github.com/dotnet/runtime/projects/48#column-9236436
The ActiveIssues and `tests.proj` exclusions have been tested on https://github.com/dotnet/runtime/pull/49917 as well.
-----------
This PR makes the following changes in the following files:
`src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj` - Removed `$(NetCoreAppCurrent)-iOS` from target frameworks as it is stated to currently only supported on Windows.
`src/libraries/tests.proj` - Update the test suites that need to be skipped at the project level, reducing the number and categorizing as a skip due to PNSE, a skip due to numerous failures, and a skip due to the suite crashing.
The remaining files changed are either:
`[ActiveIssue("<issue-url>", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]`
`[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS or tvOS.")]`
Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Tammy Qiu <[email protected]>
* refactor old APM [Begin/End]Accept methods on top of Task APIs, and enable for Unix as well
* fix BeginAccept to throw synchronously, and relevant test changes
* fix AcceptReceive test to run on unix too
* dispose accepted socket if receive throws
* remove CallbackClosure cache
* fix test helper to indicate AcceptReceive with EAP is still only supported on Windows
Co-authored-by: Geoffrey Kizer <[email protected]>
* add Task-based DisconnectAsync and refactor APM methods on top of it
* fix BeginDisconnect to throw synchronously and add relevant tests
* remove #region stuff in Socket.cs and add link to github issue
Co-authored-by: Geoffrey Kizer <[email protected]>
We have a bunch of test assemblies that don't make sense on some platforms, e.g. Browser.
Right now we're skipping them via `[SkipOnMono("reason", TestPlatforms.Browser)]` but there's nothing that inherently ties this to Mono other than the current implementation.
The more generic `SkipOnPlatform` attribute can be used instead.
We can also use it in places where we do `[PlatformSpecific(~TestPlatforms....)]` to avoid the double inversion.
* experiment: use read/write for socket operations instead of recvmsg/sendmsg
* AnonymousPipeStreams: perform async I/O by using Socket implementation
* PipeStream.Unix: use sync/async functions on Socket
* Refactor Socket creation
* Cleanup
* Fix broken comment
* Allow passing pipe fd to Socket/SafeSocketHandle public ctor
* macOS: Handle EPIPE on registration
* Refactor IsPipe to IsSocket
* Move registration error handling in to single method
* Process: use AnonymousPipeClientStream for redirected streams.
* Remove unneeded BufferedStream
* PR feedback
* PipeStream.Unix: enable cancelation tests
* Add back Ctor_SafeHandle_Invalid_ThrowsException test
* SysRead/SysWrite: Assert not used for socket-type handle