diff --git a/Tests/Opc.Ua.Client.Tests/ClientTest.cs b/Tests/Opc.Ua.Client.Tests/ClientTest.cs index 286fb61840..97a06361ac 100644 --- a/Tests/Opc.Ua.Client.Tests/ClientTest.cs +++ b/Tests/Opc.Ua.Client.Tests/ClientTest.cs @@ -654,12 +654,12 @@ static UserIdentity CreateUserIdentity(string tokenData) const string newIdentityToken = "fakeTokenStringNew"; session.RenewUserIdentity += (_, _) => CreateUserIdentity(newIdentityToken); - session.Reconnect(); + await session.ReconnectAsync().ConfigureAwait(false); receivedToken = Encoding.UTF8 .GetString(TokenValidator.LastIssuedToken.DecryptedTokenData); Assert.AreEqual(newIdentityToken, receivedToken); - StatusCode result = session.Close(); + StatusCode result = await session.CloseAsync().ConfigureAwait(false); Assert.NotNull(result); session.Dispose(); @@ -679,20 +679,20 @@ public async Task ConnectMultipleSessionsAsync() Assert.NotNull(channel); ISession session1 = ClientFixture.CreateSession(channel, endpoint); - session1.Open("Session1", null); + await session1.OpenAsync("Session1", null, CancellationToken.None).ConfigureAwait(false); ISession session2 = ClientFixture.CreateSession(channel, endpoint); - session2.Open("Session2", null); + await session2.OpenAsync("Session2", null, CancellationToken.None).ConfigureAwait(false); _ = session1.ReadValue(VariableIds.Server_ServerStatus, typeof(ServerStatusDataType)); - session1.Close(closeChannel: false); + await session1.CloseAsync(closeChannel: false).ConfigureAwait(false); session1.DetachChannel(); session1.Dispose(); _ = session2.ReadValue(VariableIds.Server_ServerStatus, typeof(ServerStatusDataType)); - session2.Close(closeChannel: false); + await session2.CloseAsync(closeChannel: false).ConfigureAwait(false); session2.DetachChannel(); session2.Dispose(); @@ -977,11 +977,11 @@ await session2.ReconnectAsync(channel2, CancellationToken.None) } session1.DeleteSubscriptionsOnClose = true; - session1.Close(1000); + await session1.CloseAsync(1000).ConfigureAwait(false); Utils.SilentDispose(session1); session2.DeleteSubscriptionsOnClose = true; - session2.Close(1000); + await session2.CloseAsync(1000).ConfigureAwait(false); Utils.SilentDispose(session2); } @@ -1067,15 +1067,15 @@ public async Task RecreateSessionWithRenewUserIdentityAsync(bool async) Assert.NotNull(value2); session1.DeleteSubscriptionsOnClose = true; - session1.Close(1000); + await session1.CloseAsync(1000).ConfigureAwait(false); Utils.SilentDispose(session1); session2.DeleteSubscriptionsOnClose = true; - session2.Close(1000); + await session2.CloseAsync(1000).ConfigureAwait(false); Utils.SilentDispose(session2); session3.DeleteSubscriptionsOnClose = true; - session3.Close(1000); + await session3.CloseAsync(1000).ConfigureAwait(false); Utils.SilentDispose(session3); } diff --git a/Tests/Opc.Ua.Client.Tests/DurableSubscriptionTest.cs b/Tests/Opc.Ua.Client.Tests/DurableSubscriptionTest.cs index 9c08930b61..acb87f7372 100644 --- a/Tests/Opc.Ua.Client.Tests/DurableSubscriptionTest.cs +++ b/Tests/Opc.Ua.Client.Tests/DurableSubscriptionTest.cs @@ -457,7 +457,7 @@ public async Task TestSessionTransferAsync(bool setSubscriptionDurable, bool res DateTime closeTime = DateTime.UtcNow; TestContext.Out.WriteLine("Session Id {0} Closed at {1}", Session.SessionId, closeTime); - Session.Close(closeChannel: false); + await Session.CloseAsync(closeChannel: false).ConfigureAwait(false); if (restartServer) { @@ -502,7 +502,7 @@ public async Task TestSessionTransferAsync(bool setSubscriptionDurable, bool res subscription.SetPublishingMode(false); - const double tolerance = 1500; + const double tolerance = 2500; TestContext.Out.WriteLine("Session StartTime at {0}", DateTimeMs(startTime)); TestContext.Out.WriteLine("Session Closed at {0}", DateTimeMs(closeTime));