From fddf41627989118e6b5698f5df4d0c8033aed815 Mon Sep 17 00:00:00 2001 From: Matt Richardson Date: Sat, 30 Oct 2021 18:32:29 +1100 Subject: [PATCH] Add a sleep to work around delay in configuration in server (#294) Similar to https://github.com/OctopusDeploy/OctopusDSC/pull/289, we want to have a sleep in another scenario --- .../Scenarios/Server_Scenario_01_Install.ps1 | 6 ++--- .../Server_Scenario_07_Reinstall.ps1 | 22 +++++++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/E2ETests/Scenarios/Server_Scenario_01_Install.ps1 b/E2ETests/Scenarios/Server_Scenario_01_Install.ps1 index e8d485012..7569a238f 100644 --- a/E2ETests/Scenarios/Server_Scenario_01_Install.ps1 +++ b/E2ETests/Scenarios/Server_Scenario_01_Install.ps1 @@ -53,14 +53,14 @@ Configuration Server_Scenario_01_Install { SetScript = { Start-Sleep -seconds 120 - Set-Content c:\temp\SleepAfterInstallHasHappened.txt -value "true" + Set-Content c:\temp\SleepAfterInstallHasHappened_Server_Scenario_01_Install.txt -value "true" } TestScript = { - return Test-Path c:\temp\SleepAfterInstallHasHappened.txt + return Test-Path c:\temp\SleepAfterInstallHasHappened_Server_Scenario_01_Install.txt } GetScript = { @{ - Result = Test-Path c:\temp\SleepAfterInstallHasHappened.txt + Result = Test-Path c:\temp\SleepAfterInstallHasHappened_Server_Scenario_01_Install.txt } } DependsOn = "[cOctopusServerUsernamePasswordAuthentication]EnableUsernamePasswordAuth" diff --git a/E2ETests/Scenarios/Server_Scenario_07_Reinstall.ps1 b/E2ETests/Scenarios/Server_Scenario_07_Reinstall.ps1 index 789ba2492..9a86c5648 100644 --- a/E2ETests/Scenarios/Server_Scenario_07_Reinstall.ps1 +++ b/E2ETests/Scenarios/Server_Scenario_07_Reinstall.ps1 @@ -41,20 +41,38 @@ Configuration Server_Scenario_07_Reinstall AllowCollectionOfUsageStatistics = $false } - cOctopusServerUsernamePasswordAuthentication "Enable Username/Password Auth" + cOctopusServerUsernamePasswordAuthentication "EnableUsernamePasswordAuth" { InstanceName = "OctopusServer" Enabled = $true DependsOn = "[cOctopusServer]OctopusServer" } + #hack until https://github.com/OctopusDeploy/Issues/issues/7113 is resolved + Script "SleepForABitToWorkaroundServerBug" + { + SetScript = { + Start-Sleep -seconds 120 + Set-Content c:\temp\SleepAfterInstallHasHappened_Server_Scenario_07_Reinstall.txt -value "true" + } + TestScript = { + return Test-Path c:\temp\SleepAfterInstallHasHappened_Server_Scenario_07_Reinstall.txt + } + GetScript = { + @{ + Result = Test-Path c:\temp\SleepAfterInstallHasHappened_Server_Scenario_07_Reinstall.txt + } + } + DependsOn = "[cOctopusServerUsernamePasswordAuthentication]EnableUsernamePasswordAuth" + } + cOctopusEnvironment "Create 'UAT 1' Environment" { Url = "http://localhost:81" Ensure = "Present" OctopusCredentials = $cred EnvironmentName = "UAT 1" - DependsOn = "[cOctopusServer]OctopusServer" + DependsOn = "[Script]SleepForABitToWorkaroundServerBug" } Script "Create Api Key and set environment variables for tests"