From 2e509620793e90823b884c8929d523ed107c3c99 Mon Sep 17 00:00:00 2001 From: Ivo van de Lagemaat Date: Fri, 20 Aug 2021 15:59:29 +0200 Subject: [PATCH] Fixed "A task was canceled" warnings when running the tests --- .../ISHRemote/Trisoft.ISHRemote/ISHRemote.PesterSetup.ps1 | 7 ++++--- .../Trisoft.ISHRemote/Objects/Public/IshSession.cs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/ISHRemote/Trisoft.ISHRemote/ISHRemote.PesterSetup.ps1 b/Source/ISHRemote/Trisoft.ISHRemote/ISHRemote.PesterSetup.ps1 index a4740b0e..2025642f 100644 --- a/Source/ISHRemote/Trisoft.ISHRemote/ISHRemote.PesterSetup.ps1 +++ b/Source/ISHRemote/Trisoft.ISHRemote/ISHRemote.PesterSetup.ps1 @@ -55,9 +55,6 @@ if ([string]::IsNullOrEmpty($ishPassword)) $ishPassword = 'admin' } -$webServicesBaseUrl = "$baseUrl/ISHWS/" # must have trailing slash for tests to succeed -$wsTrustIssuerUrl = "$baseUrl/ISHSTS/issue/wstrust/mixed/username" -$wsTrustIssuerMexUrl = "$baseUrl/ISHSTS/issue/wstrust/mex" Write-Verbose "Initializing variables for System Setup" $folderTestRootPath = "\General\__ISHRemote" # requires leading FolderPathSeparator for tests to succeed $ishLng = 'VLANGUAGEEN' @@ -91,6 +88,10 @@ if (Test-Path -Path $debugPesterSetupFilePath -PathType Leaf) } #endregion +$webServicesBaseUrl = "$baseUrl/ISHWS/" # must have trailing slash for tests to succeed +$wsTrustIssuerUrl = "$baseUrl/ISHSTS/issue/wstrust/mixed/username" +$wsTrustIssuerMexUrl = "$baseUrl/ISHSTS/issue/wstrust/mex" + $webServicesBaseUrl -match "https://((?.+))+/(.)+/" | Out-Null $hostname=$Matches['hostname'] $localWebServicesBaseUrl = $webServicesBaseUrl.Replace($hostname,"localhost") diff --git a/Source/ISHRemote/Trisoft.ISHRemote/Objects/Public/IshSession.cs b/Source/ISHRemote/Trisoft.ISHRemote/Objects/Public/IshSession.cs index 09e3d477..acc636ae 100644 --- a/Source/ISHRemote/Trisoft.ISHRemote/Objects/Public/IshSession.cs +++ b/Source/ISHRemote/Trisoft.ISHRemote/Objects/Public/IshSession.cs @@ -161,8 +161,8 @@ private void LoadConnectionConfiguration() client.Timeout = _timeout; var connectionConfigurationUri = new Uri(_webServicesBaseUri, "connectionconfiguration.xml"); _logger.WriteDebug($"LoadConnectionConfiguration uri[{connectionConfigurationUri}] timeout[{client.Timeout}]"); - var responseMessage = client.GetAsync(connectionConfigurationUri).Result; - string response = responseMessage.Content.ReadAsStringAsync().Result; + var responseMessage = client.GetAsync(connectionConfigurationUri).GetAwaiter().GetResult(); + string response = responseMessage.Content.ReadAsStringAsync().GetAwaiter().GetResult(); _ishConnectionConfiguration = new IshConnectionConfiguration(response); _logger.WriteDebug($"LoadConnectionConfiguration found InfoShareWSUrl[${_ishConnectionConfiguration.InfoShareWSUrl}] ApplicationName[${_ishConnectionConfiguration.ApplicationName}] SoftwareVersion[${_ishConnectionConfiguration.SoftwareVersion}]"); if (_ishConnectionConfiguration.InfoShareWSUrl != _webServicesBaseUri)