Fix flaky test: k8s script v1 integration test#1189
Merged
todthomson merged 3 commits intomainfrom Feb 23, 2026
Merged
Conversation
because sometimes connection to Tentacle fails, and Tentacle does the right thing (I think) and starts the script again.
LukeButters
approved these changes
Feb 23, 2026
julietrb1
approved these changes
Feb 23, 2026
julietrb1
left a comment
There was a problem hiding this comment.
I like it very much, but I've suggested shortening the comment and adding it to this PR's details instead.
...cle.Kubernetes.Tests.Integration/KubernetesAgent/KubernetesScriptServiceV1IntegrationTest.cs
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Because of an historically intermittent (flaky) test run failure, which triggers alerts to @OctopusDeploy/team-executions-foundations in test:
caused by:
which results in:
which subsequently results in an assertion failure:
caused by the following assertion:
but I think that's perfectly reasonable (i.e. it's reasonable to restart when loosing comms with Tentacle).
Results
Thus, I've updated the assertion to be "at least once":
Before
Flaky test e.g.
https://build.octopushq.com/buildConfiguration/TeamFireAndMotion_OctopusTentacle_TentacleVLatest_net80_ChainFullChainNightly/21130454
After
No more flaky test.
How to review this PR
This is how Octopus behaves when the connection to Tentacle is interrupted.
Do you agree that, therefore, the assertion in the original test "as written" was wrong?
If so, please approve.
If not, please talk to me and explain why (the assertion should remain as it is)?
Pre-requisites
Yes, this is a flaky test, I don't think it needs a GitHub issue.
Consultation plan:
My change IS a test, and, it will run in the CI environment.