This is an automated email from the ASF dual-hosted git repository.

tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton-dotnet.git


The following commit(s) were added to refs/heads/main by this push:
     new 28c43e5  PROTON-2209 Fix some timing issues in certain tests
28c43e5 is described below

commit 28c43e5761ad68facfed4f488304d18cce885441
Author: Timothy Bish <[email protected]>
AuthorDate: Wed Jan 18 17:54:47 2023 -0500

    PROTON-2209 Fix some timing issues in certain tests
---
 .../Client/Implementation/ClientConnectionTest.cs        |  4 ++--
 .../Client/Implementation/ClientReceiverTest.cs          | 10 +++++-----
 .../Client/Implementation/ClientSenderTest.cs            |  6 +++---
 .../Client/Implementation/ClientSessionTest.cs           |  8 ++++----
 .../Client/Implementation/ClientStreamReceiverTest.cs    | 16 +++++++++-------
 5 files changed, 23 insertions(+), 21 deletions(-)

diff --git 
a/test/Proton.Client.Tests/Client/Implementation/ClientConnectionTest.cs 
b/test/Proton.Client.Tests/Client/Implementation/ClientConnectionTest.cs
index 5fe11bb..73f38c7 100644
--- a/test/Proton.Client.Tests/Client/Implementation/ClientConnectionTest.cs
+++ b/test/Proton.Client.Tests/Client/Implementation/ClientConnectionTest.cs
@@ -1488,7 +1488,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
 
             IClient container = IClient.Create();
             ConnectionOptions options = ConnectionOptions();
-            options.OpenTimeout = 100;
+            options.OpenTimeout = openResponse ? 5000 : 150;
             IConnection connection = container.Connect(remoteAddress, 
remotePort, options);
 
             peer.WaitForScriptToComplete();
@@ -1555,7 +1555,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
 
             IClient container = IClient.Create();
             ConnectionOptions options = ConnectionOptions();
-            options.OpenTimeout = 100;
+            options.OpenTimeout = openResponse ? 5000 : 100;
             IConnection connection = container.Connect(remoteAddress, 
remotePort, options);
 
             peer.WaitForScriptToComplete();
diff --git 
a/test/Proton.Client.Tests/Client/Implementation/ClientReceiverTest.cs 
b/test/Proton.Client.Tests/Client/Implementation/ClientReceiverTest.cs
index 995421c..3a52d6f 100644
--- a/test/Proton.Client.Tests/Client/Implementation/ClientReceiverTest.cs
+++ b/test/Proton.Client.Tests/Client/Implementation/ClientReceiverTest.cs
@@ -1015,7 +1015,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IClient container = IClient.Create();
             ConnectionOptions options = new ConnectionOptions()
             {
-               OpenTimeout = 100
+               OpenTimeout = attachResponse ? 5000 : 100
             };
             IConnection connection = container.Connect(remoteAddress, 
remotePort, options).OpenTask.Result;
             ISession session = connection.OpenSession().OpenTask.Result;
@@ -1100,7 +1100,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IClient container = IClient.Create();
             ConnectionOptions options = new ConnectionOptions()
             {
-               OpenTimeout = 100
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             IConnection connection = container.Connect(remoteAddress, 
remotePort, options).OpenTask.Result;
             ISession session = connection.OpenSession().OpenTask.Result;
@@ -1185,7 +1185,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             ISession session = connection.OpenSession().OpenTask.Result;
             ReceiverOptions options = new ReceiverOptions()
             {
-               OpenTimeout = 100
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             IReceiver receiver = session.OpenReceiver("test-receiver", 
options);
 
@@ -1270,7 +1270,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IClient container = IClient.Create();
             ConnectionOptions options = new ConnectionOptions()
             {
-               OpenTimeout = 100
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             IConnection connection = container.Connect(remoteAddress, 
remotePort, options).OpenTask.Result;
             ISession session = connection.OpenSession().OpenTask.Result;
@@ -1355,7 +1355,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IClient container = IClient.Create();
             ConnectionOptions options = new ConnectionOptions()
             {
-               OpenTimeout = 100
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             IConnection connection = container.Connect(remoteAddress, 
remotePort, options).OpenTask.Result;
             ISession session = connection.OpenSession().OpenTask.Result;
diff --git a/test/Proton.Client.Tests/Client/Implementation/ClientSenderTest.cs 
b/test/Proton.Client.Tests/Client/Implementation/ClientSenderTest.cs
index d519642..53f84f9 100644
--- a/test/Proton.Client.Tests/Client/Implementation/ClientSenderTest.cs
+++ b/test/Proton.Client.Tests/Client/Implementation/ClientSenderTest.cs
@@ -1520,7 +1520,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             ISession session = connection.OpenSession().OpenTask.Result;
             SenderOptions options = new SenderOptions()
             {
-               OpenTimeout = 75
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             ISender sender = session.OpenSender("test-sender", options);
 
@@ -1606,7 +1606,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IClient container = IClient.Create();
             ConnectionOptions options = new ConnectionOptions()
             {
-               OpenTimeout = 75
+               OpenTimeout = attachResponse ? 5000 : 75
             };
             IConnection connection = container.Connect(remoteAddress, 
remotePort, options).OpenTask.Result;
             ISession session = connection.OpenSession().OpenTask.Result;
@@ -1690,7 +1690,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IClient container = IClient.Create();
             ConnectionOptions options = new ConnectionOptions()
             {
-               OpenTimeout = 75
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             IConnection connection = container.Connect(remoteAddress, 
remotePort, options).OpenTask.Result;
             ISession session = connection.OpenSession().OpenTask.Result;
diff --git 
a/test/Proton.Client.Tests/Client/Implementation/ClientSessionTest.cs 
b/test/Proton.Client.Tests/Client/Implementation/ClientSessionTest.cs
index 078f1d2..8bcf1d6 100644
--- a/test/Proton.Client.Tests/Client/Implementation/ClientSessionTest.cs
+++ b/test/Proton.Client.Tests/Client/Implementation/ClientSessionTest.cs
@@ -65,7 +65,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IConnection connection = container.Connect(remoteAddress, 
remotePort);
 
             SessionOptions options = new SessionOptions();
-            options.OpenTimeout = 75;
+            options.OpenTimeout = 250;
             ISession session = connection.OpenSession(options);
 
             try
@@ -237,7 +237,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IClient container = IClient.Create();
             IConnection connection = container.Connect(remoteAddress, 
remotePort);
             SessionOptions options = new SessionOptions();
-            options.CloseTimeout = 75;
+            options.CloseTimeout = 150;
             ISession session = 
connection.OpenSession(options).OpenTask.GetAwaiter().GetResult();
 
             try
@@ -338,7 +338,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IClient container = IClient.Create();
             IConnection connection = container.Connect(remoteAddress, 
remotePort);
             SessionOptions options = new SessionOptions();
-            options.OpenTimeout = 120;
+            options.OpenTimeout = beginResponse ? 5000 : 250;
             ISession session = connection.OpenSession(options);
 
             peer.WaitForScriptToComplete();
@@ -501,7 +501,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IClient container = IClient.Create();
             IConnection connection = container.Connect(remoteAddress, 
remotePort);
             SessionOptions options = new SessionOptions();
-            options.OpenTimeout = 125;
+            options.OpenTimeout = beginResponse ? 5000 : 125;
             ISession session = connection.OpenSession(options);
 
             peer.WaitForScriptToComplete();
diff --git 
a/test/Proton.Client.Tests/Client/Implementation/ClientStreamReceiverTest.cs 
b/test/Proton.Client.Tests/Client/Implementation/ClientStreamReceiverTest.cs
index e0743f0..e674829 100644
--- a/test/Proton.Client.Tests/Client/Implementation/ClientStreamReceiverTest.cs
+++ b/test/Proton.Client.Tests/Client/Implementation/ClientStreamReceiverTest.cs
@@ -1127,8 +1127,9 @@ namespace Apache.Qpid.Proton.Client.Implementation
                                  .WithMore(false)
                                  .WithMessageFormat(0)
                                  .WithPayload(payload2).Queue();
+            
peer.ExpectDisposition().WithFirst(0).WithState().Accepted().WithSettled(true).Optional();
             
peer.ExpectFlow().WithDeliveryCount(1).WithIncomingWindow(1).WithLinkCredit(9);
-            
peer.ExpectDisposition().WithFirst(0).WithState().Accepted().WithSettled(true);
+            
peer.ExpectDisposition().WithFirst(0).WithState().Accepted().WithSettled(true).Optional();
 
             byte[] combinedPayloads = new byte[payload1.Length + 
payload2.Length];
             rawStream.Read(combinedPayloads);
@@ -2548,8 +2549,9 @@ namespace Apache.Qpid.Proton.Client.Implementation
                                  .WithMore(false)
                                  .WithMessageFormat(0)
                                  .WithPayload(payload3).Queue();
+            
peer.ExpectDisposition().WithFirst(0).WithState().Accepted().WithSettled(true).Optional();
             
peer.ExpectFlow().WithDeliveryCount(1).WithIncomingWindow(1).WithLinkCredit(9);
-            
peer.ExpectDisposition().WithFirst(0).WithState().Accepted().WithSettled(true);
+            
peer.ExpectDisposition().WithFirst(0).WithState().Accepted().WithSettled(true).Optional();
 
             byte[] combinedPayloads = new byte[body1.Length + body2.Length];
             bodyStream.Read(combinedPayloads);
@@ -3634,7 +3636,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IConnection connection = container.Connect(remoteAddress, 
remotePort);
             StreamReceiverOptions options = new StreamReceiverOptions()
             {
-               OpenTimeout = 150
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             IStreamReceiver receiver = 
connection.OpenStreamReceiver("test-receiver", options);
 
@@ -3722,7 +3724,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IConnection connection = container.Connect(remoteAddress, 
remotePort);
             StreamReceiverOptions options = new StreamReceiverOptions()
             {
-               OpenTimeout = 150
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             IStreamReceiver receiver = 
connection.OpenStreamReceiver("test-receiver", options);
 
@@ -3808,7 +3810,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IConnection connection = container.Connect(remoteAddress, 
remotePort);
             StreamReceiverOptions options = new StreamReceiverOptions()
             {
-               OpenTimeout = 150
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             IStreamReceiver receiver = 
connection.OpenStreamReceiver("test-receiver", options);
 
@@ -3894,7 +3896,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
             IConnection connection = container.Connect(remoteAddress, 
remotePort);
             StreamReceiverOptions options = new StreamReceiverOptions()
             {
-               OpenTimeout = 150
+               OpenTimeout = attachResponse ? 5000 : 150
             };
             IStreamReceiver receiver = 
connection.OpenStreamReceiver("test-receiver", options);
 
@@ -3978,7 +3980,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
          IConnection connection = container.Connect(remoteAddress, remotePort);
          StreamReceiverOptions options = new StreamReceiverOptions()
          {
-            OpenTimeout = 150
+            OpenTimeout = attachResponse ? 5000 : 250
          };
          IStreamReceiver receiver = 
connection.OpenStreamReceiver("test-receiver", options);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to