From e4a5e7aa8ee2657468ed7d91a2fd00bf53ae05ba Mon Sep 17 00:00:00 2001 From: Geoff Battye <85491188+gb-8@users.noreply.github.com> Date: Thu, 26 Nov 2026 08:36:38 +0000 Subject: [PATCH] Widen StartScript wait window in short-script test to avoid flakes StartScriptShouldWaitForAShortScriptToFinish asked StartScript to wait up to 5 seconds for `echo "finished"`. On busy Windows agents, PowerShell startup alone can exceed that, so StartScript correctly returned Running and the test failed intermittently (e.g. 5,297 ms on win-x86). Raise the window to 60 seconds. StartScript returns as soon as the script completes, so passing runs are no slower. Claude-Session: https://claude.ai/code/session_012a7MWUgDDfPmxcoi6ZFskC --- .../Integration/ScriptServiceV2Fixture.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Octopus.Tentacle.Tests/Integration/ScriptServiceV2Fixture.cs b/source/Octopus.Tentacle.Tests/Integration/ScriptServiceV2Fixture.cs index d5c771eef..b34d648d1 100644 --- a/source/Octopus.Tentacle.Tests/Integration/ScriptServiceV2Fixture.cs +++ b/source/Octopus.Tentacle.Tests/Integration/ScriptServiceV2Fixture.cs @@ -191,7 +191,8 @@ public async Task StartScriptShouldWaitForAShortScriptToFinish() { var startScriptCommand = new StartScriptCommandV2Builder() .WithScriptBody("echo \"finished\"") - .WithDurationStartScriptCanWaitForScriptToFinish(TimeSpan.FromSeconds(5)) + // Generous so a slow shell startup on a busy build agent doesn't exceed the window. StartScript returns as soon as the script completes, so this doesn't slow the test down. + .WithDurationStartScriptCanWaitForScriptToFinish(TimeSpan.FromSeconds(60)) .WithIsolation(ScriptIsolationLevel.NoIsolation) .Build();