Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwoctopusdeploy committed Dec 7, 2023
1 parent 846e31c commit e3e8c9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public async Task DuringGetCapabilities_ScriptExecutionCanBeCancelled(TentacleCo
nameof(IAsyncClientCapabilitiesServiceV2.GetCapabilitiesAsync),
async (_, _) =>
{
ensureCancellationOccursDuringAnRpcCall.Release();

if (!hasPausedOrStoppedPortForwarder)
{
hasPausedOrStoppedPortForwarder = true;
Expand All @@ -68,6 +66,8 @@ public async Task DuringGetCapabilities_ScriptExecutionCanBeCancelled(TentacleCo
await tcpConnectionUtilities.EnsurePollingQueueWontSendMessageToDisconnectedTentacles();
}
}

ensureCancellationOccursDuringAnRpcCall.Release();
}, async (_, _) =>
{
await ensureCancellationOccursDuringAnRpcCall.WaitAsync(CancellationToken);
Expand Down Expand Up @@ -148,8 +148,6 @@ public async Task DuringStartScript_ScriptExecutionCanBeCancelled(TentacleConfig
nameof(IAsyncClientScriptServiceV2.StartScriptAsync),
async (_, _) =>
{
ensureCancellationOccursDuringAnRpcCall.Release();

if (!hasPausedOrStoppedPortForwarder)
{
hasPausedOrStoppedPortForwarder = true;
Expand All @@ -160,6 +158,8 @@ public async Task DuringStartScript_ScriptExecutionCanBeCancelled(TentacleConfig
await tcpConnectionUtilities.EnsurePollingQueueWontSendMessageToDisconnectedTentacles();
}
}

ensureCancellationOccursDuringAnRpcCall.Release();
})
.HookServiceMethod(tentacleConfigurationTestCase,
nameof(IAsyncClientScriptServiceV2.CancelScriptAsync),
Expand Down Expand Up @@ -258,8 +258,6 @@ public async Task DuringGetStatus_ScriptExecutionCanBeCancelled(TentacleConfigur
nameof(IAsyncClientScriptServiceV2.GetStatusAsync),
async (_, _) =>
{
ensureCancellationOccursDuringAnRpcCall.Release();

if (!hasPausedOrStoppedPortForwarder)
{
hasPausedOrStoppedPortForwarder = true;
Expand All @@ -271,6 +269,7 @@ public async Task DuringGetStatus_ScriptExecutionCanBeCancelled(TentacleConfigur
}
}

ensureCancellationOccursDuringAnRpcCall.Release();
timer.Restart();
},
async (_, _) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public async Task DuringGetCapabilities_ScriptExecutionCanBeCancelled(TentacleCo
nameof(IAsyncClientCapabilitiesServiceV2.GetCapabilitiesAsync),
async (_, _) =>
{
ensureCancellationOccursDuringAnRpcCall.Release();

if (rpcCall == RpcCall.RetryingCall &&
capabilitiesMethodUsages.For(nameof(IAsyncClientCapabilitiesServiceV2.GetCapabilitiesAsync)).LastException == null)
{
Expand All @@ -81,6 +79,8 @@ public async Task DuringGetCapabilities_ScriptExecutionCanBeCancelled(TentacleCo
await tcpConnectionUtilities.EnsurePollingQueueWontSendMessageToDisconnectedTentacles();
}
}

ensureCancellationOccursDuringAnRpcCall.Release();
}, async (_, _) =>
{
await ensureCancellationOccursDuringAnRpcCall.WaitAsync(CancellationToken);
Expand Down Expand Up @@ -179,8 +179,6 @@ public async Task DuringStartScript_ScriptExecutionCanBeCancelled(TentacleConfig
nameof(IAsyncClientScriptServiceV2.StartScriptAsync),
async (_, _) =>
{
ensureCancellationOccursDuringAnRpcCall.Release();

if (rpcCall == RpcCall.RetryingCall &&
recordedUsages.For(nameof(IAsyncClientScriptServiceV2.StartScriptAsync)).LastException is null)
{
Expand All @@ -202,6 +200,7 @@ public async Task DuringStartScript_ScriptExecutionCanBeCancelled(TentacleConfig
}
}

ensureCancellationOccursDuringAnRpcCall.Release();
timer.Restart();
},
async (_, _) =>
Expand Down Expand Up @@ -335,8 +334,6 @@ public async Task DuringGetStatus_ScriptExecutionCanBeCancelled(TentacleConfigur
nameof(IAsyncClientScriptServiceV2.GetStatusAsync),
async (_, _) =>
{
ensureCancellationOccursDuringAnRpcCall.Release();

if (rpcCall == RpcCall.RetryingCall &&
recordedUsages.For(nameof(IAsyncClientScriptServiceV2.GetStatusAsync)).LastException is null)
{
Expand All @@ -358,6 +355,7 @@ public async Task DuringGetStatus_ScriptExecutionCanBeCancelled(TentacleConfigur
}
}

ensureCancellationOccursDuringAnRpcCall.Release();
timer.Restart();
},
async (_, _) =>
Expand Down

0 comments on commit e3e8c9e

Please sign in to comment.