fix(management): 5-min Ask timeout for transport/deploy commands (arch-review S1)
Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
@@ -99,4 +99,30 @@ public class ManagementEndpointsTests
|
||||
|
||||
Assert.Equal(TimeSpan.FromSeconds(30), timeout);
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// Per-command long-running Ask timeout (arch-review S1)
|
||||
//
|
||||
// Transport/deploy commands legitimately run for minutes; they must use the
|
||||
// LongRunningCommandTimeout (default 5 min) instead of the 30 s default.
|
||||
// ========================================================================
|
||||
|
||||
[Theory]
|
||||
[InlineData(typeof(ImportBundleCommand))]
|
||||
[InlineData(typeof(ExportBundleCommand))]
|
||||
[InlineData(typeof(PreviewBundleCommand))]
|
||||
[InlineData(typeof(MgmtDeployArtifactsCommand))]
|
||||
[InlineData(typeof(MgmtDeployInstanceCommand))]
|
||||
public void ResolveAskTimeout_LongRunningCommand_UsesLongTimeout(Type cmd)
|
||||
=> Assert.Equal(TimeSpan.FromMinutes(5), ManagementEndpoints.ResolveAskTimeout(null, cmd));
|
||||
|
||||
[Fact]
|
||||
public void ResolveAskTimeout_OrdinaryCommand_UsesDefault()
|
||||
=> Assert.Equal(TimeSpan.FromSeconds(30), ManagementEndpoints.ResolveAskTimeout(null, typeof(ListTemplatesCommand)));
|
||||
|
||||
[Fact]
|
||||
public void ResolveAskTimeout_ConfiguredLongTimeout_Honored()
|
||||
=> Assert.Equal(TimeSpan.FromMinutes(10), ManagementEndpoints.ResolveAskTimeout(
|
||||
new ManagementServiceOptions { LongRunningCommandTimeout = TimeSpan.FromMinutes(10) },
|
||||
typeof(ImportBundleCommand)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user