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

ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 4c295f544e IGNITE-20785 .NET: Fix BasicAuthenticatorTests flakiness 
(#2809)
4c295f544e is described below

commit 4c295f544e82d3942b7b65168c64f57d7674fe07
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Tue Nov 7 14:48:25 2023 +0200

    IGNITE-20785 .NET: Fix BasicAuthenticatorTests flakiness (#2809)
    
    Wait for the configuration change to be applied by the server when 
disabling authentication.
---
 .../Apache.Ignite.Tests/BasicAuthenticatorTests.cs | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Tests/BasicAuthenticatorTests.cs 
b/modules/platforms/dotnet/Apache.Ignite.Tests/BasicAuthenticatorTests.cs
index 47af9b2b07..b6136ebb54 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Tests/BasicAuthenticatorTests.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Tests/BasicAuthenticatorTests.cs
@@ -32,12 +32,7 @@ public class BasicAuthenticatorTests : IgniteTestsBase
     private bool _authnEnabled;
 
     [TearDown]
-    public async Task DisableAuthenticationAfterTest()
-    {
-        await EnableAuthn(false);
-
-        Assert.DoesNotThrowAsync(async () => await 
Client.Tables.GetTablesAsync());
-    }
+    public async Task DisableAuthenticationAfterTest() => await 
EnableAuthn(false);
 
     [Test]
     public async Task TestAuthnOnClientNoAuthnOnServer()
@@ -117,6 +112,21 @@ public class BasicAuthenticatorTests : IgniteTestsBase
             // Wait for the server to apply the configuration change and drop 
the client connection.
             client.WaitForConnections(0, 3000);
         }
+        else
+        {
+            await TestUtils.WaitForConditionAsync(async () =>
+            {
+                try
+                {
+                    await Client.Tables.GetTablesAsync();
+                    return true;
+                }
+                catch (Exception)
+                {
+                    return false;
+                }
+            });
+        }
 
         _authnEnabled = enable;
     }

Reply via email to