Skip to content

Commit

Permalink
Fixed "A task was canceled" warnings when running the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandelagemaat committed Aug 20, 2021
1 parent 814b16f commit 2e50962
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Source/ISHRemote/Trisoft.ISHRemote/ISHRemote.PesterSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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://((?<hostname>.+))+/(.)+/" | Out-Null
$hostname=$Matches['hostname']
$localWebServicesBaseUrl = $webServicesBaseUrl.Replace($hostname,"localhost")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2e50962

Please sign in to comment.