Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-44911: [C#] Choose port numbers dynamically for ArrowStreamWriterTests #44912

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions csharp/test/Apache.Arrow.Tests/ArrowStreamWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ public void Ctor_LeaveOpenTrue_StreamValidOnDispose()
}

[Theory]
[InlineData(true, 32153)]
[InlineData(false, 32154)]
public void CanWriteToNetworkStream(bool createDictionaryArray, int port)
[InlineData(true)]
[InlineData(false)]
public void CanWriteToNetworkStream(bool createDictionaryArray)
{
RecordBatch originalBatch = TestData.CreateSampleRecordBatch(length: 100, createDictionaryArray: createDictionaryArray);

TcpListener listener = new TcpListener(IPAddress.Loopback, port);
TcpListener listener = new TcpListener(IPAddress.Loopback, 0);
listener.Start();
int port = ((IPEndPoint)listener.LocalEndpoint).Port;

using (TcpClient sender = new TcpClient())
{
Expand Down Expand Up @@ -92,14 +93,15 @@ public void CanWriteToNetworkStream(bool createDictionaryArray, int port)
}

[Theory]
[InlineData(true, 32155)]
[InlineData(false, 32156)]
public async Task CanWriteToNetworkStreamAsync(bool createDictionaryArray, int port)
[InlineData(true)]
[InlineData(false)]
public async Task CanWriteToNetworkStreamAsync(bool createDictionaryArray)
{
RecordBatch originalBatch = TestData.CreateSampleRecordBatch(length: 100, createDictionaryArray: createDictionaryArray);

TcpListener listener = new TcpListener(IPAddress.Loopback, port);
TcpListener listener = new TcpListener(IPAddress.Loopback, 0);
listener.Start();
int port = ((IPEndPoint)listener.LocalEndpoint).Port;

using (TcpClient sender = new TcpClient())
{
Expand Down
Loading