-
Notifications
You must be signed in to change notification settings - Fork 23
Tentacle Abandon Script #1226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jimmyp
wants to merge
16
commits into
main
Choose a base branch
from
jimpelletier/eft-3295-tentacle-script-abandonment-to-release-the-mutex
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Tentacle Abandon Script #1226
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9073427
Tentacle script abandonment (re-landed on main)
jimmyp 4f3fc4d
Address review: remove abandon capability check, drop abandon metrics…
jimmyp e797a67
Apply review: concise AbandonScript summary on ITentacleClient
jimmyp 06517d6
Address review: V1/K8s abandon throws + orchestrator is abandon-aware…
jimmyp ffa5b82
Test at the right boundary: drop duplicate/wrong-level abandon tests
jimmyp d03dcfb
Add AbandonScriptAsync to IAsyncScriptServiceV2 (unblocks server test…
jimmyp 65a6db5
Fix race in abandon integration tests: assert ExecuteScript's result,…
jimmyp 96babdd
Reword abandon wait/cleanup comments in SilentProcessRunner
jimmyp 23059e4
Address PR review feedback on abandon
jimmyp 7ee0fdb
Keep grandchild cleanup best-effort (can't assert a reparented non-ch…
jimmyp 86ef03a
Gate abandon on the advertised capability, not just "is V2", + test r…
jimmyp d4e85ba
Restore @jimmyp's applied suggestions clobbered by my force-push
jimmyp 5fd82a5
Put SupportsAbandon on ScriptServiceVersion (ScriptServiceVersion2Wit…
jimmyp 21b8d2a
Address review: ScriptServiceVersion.IsV2, split escalation test, V1 …
jimmyp d195d65
Make the escalation split meaningful: each test asserts a distinct ef…
jimmyp a2e283b
Merge remote-tracking branch 'origin/main' into jimpelletier/eft-3295…
jimmyp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
1,000 changes: 1,000 additions & 0 deletions
1,000
...rpowers/plans/2026-06-01-abandon-best-effort-kill-and-execute-script-timeout.md
Large diffs are not rendered by default.
Oops, something went wrong.
477 changes: 477 additions & 0 deletions
477
docs/superpowers/specs/2026-05-21-tentacle-script-abandon-design.md
Large diffs are not rendered by default.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
source/Octopus.Tentacle.Client.Tests/ScriptServiceVersionSelectorTests.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using FluentAssertions; | ||
| using Halibut.ServiceModel; | ||
| using NSubstitute; | ||
| using NUnit.Framework; | ||
| using Octopus.Tentacle.Client.Execution; | ||
| using Octopus.Tentacle.Client.Observability; | ||
| using Octopus.Tentacle.Client.Retries; | ||
| using Octopus.Tentacle.Client.Scripts; | ||
| using Octopus.Tentacle.Contracts; | ||
| using Octopus.Tentacle.Contracts.Capabilities; | ||
| using Octopus.Tentacle.Contracts.ClientServices; | ||
| using Octopus.Tentacle.Contracts.Logging; | ||
| using Octopus.Tentacle.Contracts.Observability; | ||
| using Octopus.Tentacle.Contracts.ScriptServiceV2; | ||
|
|
||
| namespace Octopus.Tentacle.Client.Tests | ||
| { | ||
| [TestFixture] | ||
| public class ScriptServiceVersionSelectorTests | ||
| { | ||
| [Test] | ||
| public async Task WhenTheTentacleAdvertisesAbandon_SupportsAbandonIsTrue() | ||
| { | ||
| var (version, supportsAbandon) = await SelectFor( | ||
| nameof(IScriptService), nameof(IFileTransferService), nameof(IScriptServiceV2), nameof(IAsyncClientScriptServiceV2.AbandonScriptAsync)); | ||
|
|
||
| version.Should().Be(ScriptServiceVersion.ScriptServiceVersion2); | ||
| supportsAbandon.Should().BeTrue(); | ||
| } | ||
|
|
||
| [Test] | ||
| public async Task WhenAnOlderV2TentacleDoesNotAdvertiseAbandon_SupportsAbandonIsFalse() | ||
| { | ||
| // Old V2 Tentacles are V2 but predate the abandon verb. Gating on "is V2" would wrongly let the | ||
| // orchestrator call AbandonScript on them; gating on the advertised capability does not. | ||
| var (version, supportsAbandon) = await SelectFor( | ||
| nameof(IScriptService), nameof(IFileTransferService), nameof(IScriptServiceV2)); | ||
|
|
||
| version.Should().Be(ScriptServiceVersion.ScriptServiceVersion2); | ||
| supportsAbandon.Should().BeFalse(); | ||
| } | ||
|
|
||
| [Test] | ||
| public async Task WhenTheTentacleOnlyHasV1_SupportsAbandonIsFalse() | ||
| { | ||
| var (version, supportsAbandon) = await SelectFor( | ||
| nameof(IScriptService), nameof(IFileTransferService)); | ||
|
|
||
| version.Should().Be(ScriptServiceVersion.ScriptServiceVersion1); | ||
| supportsAbandon.Should().BeFalse(); | ||
| } | ||
|
|
||
| static async Task<(ScriptServiceVersion Version, bool SupportsAbandon)> SelectFor(params string[] capabilities) | ||
| { | ||
| var capabilitiesService = Substitute.For<IAsyncClientCapabilitiesServiceV2>(); | ||
| capabilitiesService.GetCapabilitiesAsync(Arg.Any<HalibutProxyRequestOptions>()) | ||
| .Returns(Task.FromResult(new CapabilitiesResponseV2(new List<string>(capabilities)))); | ||
|
|
||
| var selector = new ScriptServiceVersionSelector( | ||
| capabilitiesService, | ||
| Substitute.For<ITentacleClientTaskLog>(), | ||
| RpcCallExecutorFactory.Create(TimeSpan.Zero, Substitute.For<ITentacleClientObserver>()), | ||
| new TentacleClientOptions(new RpcRetrySettings(RetriesEnabled: false, RetryDuration: TimeSpan.Zero)), | ||
| ClientOperationMetricsBuilder.Start()); | ||
|
|
||
| return await selector.DetermineScriptServiceVersionToUse(CancellationToken.None); | ||
| } | ||
| } | ||
| } |
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rename to something like cancelling duration