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

Fix for Configure_server_connection_listen_backlog test #4100

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

pepone
Copy link
Member

@pepone pepone commented Nov 14, 2024

Fix #4099

@pepone
Copy link
Member Author

pepone commented Nov 14, 2024

  IceRpc.Tests test net9.0 succeeded (25.2s)
  IceRpc.Tests test net8.0 failed with 1 error(s) (25.7s)
    C:\Users\jose\source\repos\icerpc-csharp\tests\IceRpc.Tests\Transports\Tcp\TcpTransportTests.cs(196): error TESTERROR:
      IceRpc:Tests:Transports:Tcp:TcpTransportTests:Configure_server_connection_listen_backlog (621ms): Error Message:   Assert.That(connections, Has.Count.LessThanOrEqualTo(30))
        Expected: property Count less than or equal to 30
        But was:  31

      Stack Trace:
         at IceRpc.Tests.Transports.Tcp.TcpTransportTests.Configure_server_connection_listen_backlog() in C:\Users\jose\source\repos\icerpc-csharp\tests\IceRpc.Tests\Transports\Tcp\TcpTran
      sportTests.cs:line 196
         at IceRpc.Tests.Transports.Tcp.TcpTransportTests.Configure_server_connection_listen_backlog() in C:\Users\jose\source\repos\icerpc-csharp\tests\IceRpc.Tests\Transports\Tcp\TcpTran
      sportTests.cs:line 198
         at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
         at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
         at NUnit.Framework.Internal.AsyncToSyncAdapter.Await[TResult](Func`1 invoke)
         at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
         at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
         at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
         at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass3_0.<PerformWork>b__0()
         at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)

      1)    at IceRpc.Tests.Transports.Tcp.TcpTransportTests.Configure_server_connection_listen_backlog() in C:\Users\jose\source\repos\icerpc-csharp\tests\IceRpc.Tests\Transports\Tcp\TcpT
      ransportTests.cs:line 196

Sill getting an sporadic failure when running in a loop.

@pepone
Copy link
Member Author

pepone commented Nov 14, 2024

Tried with 35, but still got a failure with 47 accepted connections:

    C:\Users\jose\source\repos\icerpc-csharp\tests\IceRpc.Tests\Transports\Tcp\TcpTransportTests.cs(196): error TESTERROR:
      IceRpc:Tests:Transports:Tcp:TcpTransportTests:Configure_server_connection_listen_backlog (604ms): Error Message:   Assert.That(connections, Has.Count.LessThanOrEqualTo(35))
        Expected: property Count less than or equal to 35
        But was:  47

      Stack Trace:
         at IceRpc.Tests.Transports.Tcp.TcpTransportTests.Configure_server_connection_listen_backlog() in C:\Users\jose\source\repos\icerpc-csharp\tests\IceRpc.Tests\Transports\Tcp\TcpTran
      sportTests.cs:line 196
         at IceRpc.Tests.Transports.Tcp.TcpTransportTests.Configure_server_connection_listen_backlog() in C:\Users\jose\source\repos\icerpc-csharp\tests\IceRpc.Tests\Transports\Tcp\TcpTran
      sportTests.cs:line 198
         at NUnit.Framework.Internal.AsyncToSyncAdapter.Await[TResult](Func`1 invoke)
         at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
         at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
         at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass3_0.<PerformWork>b__0()
         at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)

Copy link
Member

@bernardnormier bernardnormier left a comment

Choose a reason for hiding this comment

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

After looking at this test, I understand that when duplexConnection.ConnectAsync() completes successfully in a client, it means:

  • the server accepted the connection (via AcceptAsync on the listener), or
  • the server didn't accept the connection yet but kept in the its listen backlog, and this listen backlog isn't full yet (with some wiggle room apparently)

It would be nice to explain this in the remarks of the duplex connection APIs.

@pepone pepone merged commit afc3e10 into icerpc:main Nov 14, 2024
8 checks passed
pepone added a commit to pepone/icerpc-csharp that referenced this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Listen backlog test failure
3 participants