Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Tests/Opc.Ua.Client.Tests/ClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/Opc.Ua.Client.Tests/DurableSubscriptionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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));
Expand Down
Loading