mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: Increase credential timeout for Integration Tests (#4472)
* Increase credential timeout for Integration Tests * Fix format error. * Update further tests * Fix comment * Rename credentials file and class. * Fix broken reference.
This commit is contained in:
committed by
GitHub
Unverified
parent
d02051dbb6
commit
6dc65dbaa1
@@ -0,0 +1,9 @@
|
||||
# Integration Tests Azure Credentials
|
||||
|
||||
Adds a helper for loading Azure credentials in integration tests.
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<InjectSharedIntegrationTestAzureCredentialsCode>true</InjectSharedIntegrationTestAzureCredentialsCode>
|
||||
</PropertyGroup>
|
||||
```
|
||||
@@ -0,0 +1,28 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
#pragma warning disable IDE0005 // This is required in some projects and not in others.
|
||||
using System;
|
||||
#pragma warning restore IDE0005
|
||||
using Azure.Identity;
|
||||
|
||||
namespace Shared.IntegrationTests;
|
||||
|
||||
/// <summary>
|
||||
/// Provides credential instances for integration tests with
|
||||
/// increased timeouts to avoid CI pipeline authentication failures.
|
||||
/// </summary>
|
||||
internal static class TestAzureCliCredentials
|
||||
{
|
||||
/// <summary>
|
||||
/// The default timeout for Azure CLI credential operations.
|
||||
/// Increased from the default (~13s) to accommodate CI pipeline latency.
|
||||
/// </summary>
|
||||
private static readonly TimeSpan s_processTimeout = TimeSpan.FromSeconds(60);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="AzureCliCredential"/> with an increased process timeout
|
||||
/// suitable for CI environments.
|
||||
/// </summary>
|
||||
public static AzureCliCredential CreateAzureCliCredential() =>
|
||||
new(new AzureCliCredentialOptions { ProcessTimeout = s_processTimeout });
|
||||
}
|
||||
Reference in New Issue
Block a user