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

SendPacketsElement_FileStreamMultiPartMixed_MultipleFileStreams_Success failed on windows.11.amd64.clientpre.open #58898

Closed
am11 opened this issue Sep 9, 2021 · 7 comments · Fixed by #63702
Assignees
Labels
area-System.Net.Sockets disabled-test The test is disabled in source code against the issue os-windows11 test-run-core Test failures in .NET Core test runs
Milestone

Comments

@am11
Copy link
Member

am11 commented Sep 9, 2021

console logs

Console log: 'System.Net.Sockets.Tests' from job e457674b-7219-466a-98c7-d70d9c28d450 workitem 92e9af85-9f63-4cdc-ac3e-0569378e4d26 (windows.11.amd64.clientpre.open) executed on machine a0000GB
[snip]
C:\h\w\9FFD08CE\w\B423098F\e>"C:\h\w\9FFD08CE\p\dotnet.exe" exec --runtimeconfig System.Net.Sockets.Tests.runtimeconfig.json --depsfile System.Net.Sockets.Tests.deps.json xunit.console.dll System.Net.Sockets.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Net.Sockets.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Net.Sockets.Tests (found 1305 of 1676 test cases)
  Starting:    System.Net.Sockets.Tests (parallel test collections = on, max threads = 2)
    System.Net.Sockets.Tests.KeepAliveTest.Socket_KeepAlive_RetryCount_Failure [SKIP]
      Condition(s) not met: "IsWindowsBelow1703"
    System.Net.Sockets.Tests.UnixDomainSocketTest.Socket_CreateUnixDomainSocket_Throws_OnWindows [SKIP]
      Condition(s) not met: "IsSubWindows10"
    System.Net.Sockets.Tests.SendPacketsAsync.SendPacketsElement_FileStreamMultiPartMixed_MultipleFileStreams_Success [FAIL]
      Timed out
      Expected: True
      Actual:   False
      Stack Trace:
        /_/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs(693,0): at System.Net.Sockets.Tests.SendPacketsAsync.SendPackets(SendPacketsElement[] elements, SocketError expectedResult, Int32 bytesExpected, Byte[] contentExpected)
        /_/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs(598,0): at System.Net.Sockets.Tests.SendPacketsAsync.SendPacketsElement_FileStreamMultiPartMixed_MultipleFileStreams_Success()
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Net.Sockets untriaged New issue has not been triaged by the area owner labels Sep 9, 2021
@ghost
Copy link

ghost commented Sep 9, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

console logs

Console log: 'System.Net.Sockets.Tests' from job e457674b-7219-466a-98c7-d70d9c28d450 workitem 92e9af85-9f63-4cdc-ac3e-0569378e4d26 (windows.11.amd64.clientpre.open) executed on machine a0000GB
[snip]
C:\h\w\9FFD08CE\w\B423098F\e>"C:\h\w\9FFD08CE\p\dotnet.exe" exec --runtimeconfig System.Net.Sockets.Tests.runtimeconfig.json --depsfile System.Net.Sockets.Tests.deps.json xunit.console.dll System.Net.Sockets.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Net.Sockets.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Net.Sockets.Tests (found 1305 of 1676 test cases)
  Starting:    System.Net.Sockets.Tests (parallel test collections = on, max threads = 2)
    System.Net.Sockets.Tests.KeepAliveTest.Socket_KeepAlive_RetryCount_Failure [SKIP]
      Condition(s) not met: "IsWindowsBelow1703"
    System.Net.Sockets.Tests.UnixDomainSocketTest.Socket_CreateUnixDomainSocket_Throws_OnWindows [SKIP]
      Condition(s) not met: "IsSubWindows10"
    System.Net.Sockets.Tests.SendPacketsAsync.SendPacketsElement_FileStreamMultiPartMixed_MultipleFileStreams_Success [FAIL]
      Timed out
      Expected: True
      Actual:   False
      Stack Trace:
        /_/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs(693,0): at System.Net.Sockets.Tests.SendPacketsAsync.SendPackets(SendPacketsElement[] elements, SocketError expectedResult, Int32 bytesExpected, Byte[] contentExpected)
        /_/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs(598,0): at System.Net.Sockets.Tests.SendPacketsAsync.SendPacketsElement_FileStreamMultiPartMixed_MultipleFileStreams_Success()
Author: am11
Assignees: -
Labels:

area-System.Net.Sockets, untriaged

Milestone: -

@karelz
Copy link
Member

karelz commented Sep 14, 2021

@antonfirsov can you help with this one? It seems to fail in CI on Win11.

@aik-jahoda
Copy link
Contributor

Test disabled in #59203 to suppress CI noise. We should fix/investigate the timeout soon ideally prior backport to 6.0

@karelz karelz added the disabled-test The test is disabled in source code against the issue label Sep 16, 2021
@antonfirsov
Copy link
Member

Failures are not specific to the test case mentioned, disabling 2 more cases in #59359.

@wfurt
Copy link
Member

wfurt commented Sep 26, 2021

looks similar to #51651. Probably just timing....?

@antonfirsov
Copy link
Member

antonfirsov commented Sep 27, 2021

The following code timeouts (hangs) regardless of the timeout value being used:

string tempFile = Path.GetTempFileName();
byte[] content = new byte[1024];
File.WriteAllBytes(tempFile, content);
using FileStream fileStream1 = new FileStream(tempFile, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, FileOptions.Asynchronous);

using Socket listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
listener.Bind(new IPEndPoint(IPAddress.Loopback, 0));
int port = ((IPEndPoint)listener.LocalEndPoint).Port;
listener.Listen();

EventWaitHandle completed = new ManualResetEvent(false);
using Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
client.Connect(new IPEndPoint(IPAddress.Loopback, port));
using Socket server = listener.Accept();

for (int i = 0; i < 10_000; i++)
{
    completed.Reset();

    using SocketAsyncEventArgs args = new SocketAsyncEventArgs();

    args.Completed += static (_, e) => ((EventWaitHandle)e.UserToken).Set();
    args.UserToken = completed;
    args.SendPacketsElements = GetElements();

    if (client.SendPacketsAsync(args))
    {
        if (!completed.WaitOne(30_000))
        {
            throw new Exception($"Timed out @ {i}");
        }
    }
}

SendPacketsElement[] GetElements()
{
    const int N = 64;
    int part = (int)fileStream1.Length / N;
    SendPacketsElement[] result = new SendPacketsElement[N];
    for (int i = 0; i < result.Length; i++)
    {
        result[i] = new SendPacketsElement(fileStream1, i * part, 10);
    }
    return result;
}

It needs different amount of itereations on different platforms:

  • On Windows 10: 4094 iterations
  • On Windows 11: 3479 iterations
  • Ubuntu (surprisingly): 858 iterations

I don't understand why don't we see any Linux failures in CI, but it's possible that some internal winsock tuning made a bug visible on Windows 11.

@wfurt I wonder if you can spot something incorrect / unusual in my repro code, or are we safe to declare this as a bug?

@danmoseley
Copy link
Member

This now failed on net6.0-windows-Debug-x86-CoreCLR_release-Windows.7.Amd64.Open as well. -- #58898

@antonfirsov per links above there's several failures in 2 days on release/6.0.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jan 12, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jan 15, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Feb 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Sockets disabled-test The test is disabled in source code against the issue os-windows11 test-run-core Test failures in .NET Core test runs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants