From dcb8829835c21320baf5f4f0128b36336a57a9a8 Mon Sep 17 00:00:00 2001 From: Tod Thomson Date: Mon, 23 Feb 2026 12:06:55 +1000 Subject: [PATCH 1/3] fix: StartScriptAsync.Started.Should().BeGreaterThanOrEqualTo(1)... because sometimes connection to Tentacle fails, and Tentacle does the right thing (I think) and starts the script again. --- .../KubernetesScriptServiceV1IntegrationTest.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs b/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs index 16593ccb7..f8a2e4ad9 100644 --- a/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs +++ b/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs @@ -56,7 +56,16 @@ public async Task RunSimpleScript(ScriptType scriptType) result.ExitCode.Should().Be(0); result.State.Should().Be(ProcessState.Complete); - recordedMethodUsages.For(nameof(IAsyncClientKubernetesScriptServiceV1.StartScriptAsync)).Started.Should().Be(1); + // re: flaky: "An error occurred communicating with Tentacle. + // This action will be retried after 1 second. + // Retry attempt 1. + // Retries will be performed for up to 89 seconds." + // Note: Occasionally we see that communication with Tentacle gets interrupted, + // and Tentacle does what it _should_ do and reconnects and restarts the script. + // Action: This seems like what you would want to happen, + // so I've updated this assertion to: BeGreaterThanOrEqualTo(1). + recordedMethodUsages.For(nameof(IAsyncClientKubernetesScriptServiceV1.StartScriptAsync)).Started.Should().BeGreaterThanOrEqualTo(1); + recordedMethodUsages.For(nameof(IAsyncClientKubernetesScriptServiceV1.GetStatusAsync)).Started.Should().BeGreaterThan(1); recordedMethodUsages.For(nameof(IAsyncClientKubernetesScriptServiceV1.CompleteScriptAsync)).Started.Should().Be(1); recordedMethodUsages.For(nameof(IAsyncClientKubernetesScriptServiceV1.CancelScriptAsync)).Started.Should().Be(0); From 02921bbd9989d78b4973eb7a24653597a9cf728d Mon Sep 17 00:00:00 2001 From: Tod Thomson Date: Mon, 23 Feb 2026 12:10:54 +1000 Subject: [PATCH 2/3] misc: comments only --- .../KubernetesScriptServiceV1IntegrationTest.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs b/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs index f8a2e4ad9..e9411c8bf 100644 --- a/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs +++ b/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs @@ -57,11 +57,11 @@ public async Task RunSimpleScript(ScriptType scriptType) result.State.Should().Be(ProcessState.Complete); // re: flaky: "An error occurred communicating with Tentacle. - // This action will be retried after 1 second. - // Retry attempt 1. - // Retries will be performed for up to 89 seconds." + // This action will be retried after 1 second. + // Retry attempt 1. + // Retries will be performed for up to 89 seconds." // Note: Occasionally we see that communication with Tentacle gets interrupted, - // and Tentacle does what it _should_ do and reconnects and restarts the script. + // and Tentacle does what it _should_ do (I think) and reconnects and restarts the script. // Action: This seems like what you would want to happen, // so I've updated this assertion to: BeGreaterThanOrEqualTo(1). recordedMethodUsages.For(nameof(IAsyncClientKubernetesScriptServiceV1.StartScriptAsync)).Started.Should().BeGreaterThanOrEqualTo(1); From 60723d2e882d5039488228f3fa2e8b7d50d3932a Mon Sep 17 00:00:00 2001 From: Tod Thomson Date: Mon, 23 Feb 2026 12:37:53 +1000 Subject: [PATCH 3/3] misc: fix comment from PR review only --- .../KubernetesScriptServiceV1IntegrationTest.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs b/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs index e9411c8bf..f97188cd6 100644 --- a/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs +++ b/source/Octopus.Tentacle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs @@ -56,14 +56,8 @@ public async Task RunSimpleScript(ScriptType scriptType) result.ExitCode.Should().Be(0); result.State.Should().Be(ProcessState.Complete); - // re: flaky: "An error occurred communicating with Tentacle. - // This action will be retried after 1 second. - // Retry attempt 1. - // Retries will be performed for up to 89 seconds." - // Note: Occasionally we see that communication with Tentacle gets interrupted, - // and Tentacle does what it _should_ do (I think) and reconnects and restarts the script. - // Action: This seems like what you would want to happen, - // so I've updated this assertion to: BeGreaterThanOrEqualTo(1). + // We occasionally see that communication with Tentacle gets interrupted, causing Tentacle to reconnect and restart the script. + // This could therefore happen more than once, which this assertion supports. recordedMethodUsages.For(nameof(IAsyncClientKubernetesScriptServiceV1.StartScriptAsync)).Started.Should().BeGreaterThanOrEqualTo(1); recordedMethodUsages.For(nameof(IAsyncClientKubernetesScriptServiceV1.GetStatusAsync)).Started.Should().BeGreaterThan(1);