Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix BeginConnect_EndPoint_AddressFamily_Throws_NotSupported test for netfx#29484

Merged
stephentoub merged 2 commits intodotnet:masterfrom
stephentoub:beginconnectfix
May 3, 2018
Merged

Fix BeginConnect_EndPoint_AddressFamily_Throws_NotSupported test for netfx#29484
stephentoub merged 2 commits intodotnet:masterfrom
stephentoub:beginconnectfix

Conversation

@stephentoub
Copy link
Member

The test fails on .NET 4.7.2 due to trying to use the same Socket instance for a connection attempt after invalid arguments were passed to a previous attempt. Since that's not what this test is about, I'm just fixing it to avoid reusing the same Socket instance.

Fixes https://github.com/dotnet/corefx/issues/29481
Contributes to #29456

cc: @davidsh, @Caesar1995

…netfx

The test fails on .NET 4.7.2 due to trying to use the same Socket instance for a connection attempt after invalid arguments were passed to a previous attempt.  Since that's not what this test is about, I'm just fixing it to avoid reusing the same Socket instance.
new DnsEndPoint("localhost", 1, AddressFamily.InterNetworkV6), TheAsyncCallback, null));
Assert.Throws<NotSupportedException>(() => { GetSocket(AddressFamily.InterNetwork).ConnectAsync(
new DnsEndPoint("localhost", 1, AddressFamily.InterNetworkV6)); });
// Unlike other tests that reuse a static Socket instance, this tests avoids doing so
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "this tests avoids doing so" -> "this test avoids doing so"

Copy link
Contributor

@davidsh davidsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment but otherwise LGTM.

Copy link
Contributor

@caesar-chen caesar-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@stephentoub stephentoub merged commit c69beb4 into dotnet:master May 3, 2018
@stephentoub stephentoub deleted the beginconnectfix branch May 3, 2018 19:02
@karelz karelz added this to the 2.2.0 milestone May 5, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…netfx (dotnet/corefx#29484)

* Fix BeginConnect_EndPoint_AddressFamily_Throws_NotSupported test for netfx

The test fails on .NET 4.7.2 due to trying to use the same Socket instance for a connection attempt after invalid arguments were passed to a previous attempt.  Since that's not what this test is about, I'm just fixing it to avoid reusing the same Socket instance.

* Fix comment typo


Commit migrated from dotnet/corefx@c69beb4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BeginConnect_EndPoint_AddressFamily_Throws_NotSupported test fails deterministically on netfx on RS4

4 participants