Skip to content

Commit 2675518

Browse files
authored
[MetricsAdvisor] Doubled maximum number of retries in tests (Azure#20653)
1 parent 4673c0f commit 2675518

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/MetricsAdvisorLiveTestBase.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Generic;
66
using Azure.AI.MetricsAdvisor.Administration;
77
using Azure.AI.MetricsAdvisor.Models;
8+
using Azure.Core;
89
using Azure.Core.TestFramework;
910
using NUnit.Framework;
1011

@@ -38,7 +39,7 @@ public MetricsAdvisorLiveTestBase(bool isAsync) : base(isAsync)
3839
public MetricsAdvisorAdministrationClient GetMetricsAdvisorAdministrationClient(bool useTokenCredential = false)
3940
{
4041
var endpoint = new Uri(TestEnvironment.MetricsAdvisorUri);
41-
var instrumentedOptions = InstrumentClientOptions(new MetricsAdvisorClientsOptions());
42+
var instrumentedOptions = GetInstrumentedOptions();
4243

4344
MetricsAdvisorAdministrationClient client = useTokenCredential
4445
? new(endpoint, TestEnvironment.Credential, instrumentedOptions)
@@ -50,7 +51,7 @@ public MetricsAdvisorAdministrationClient GetMetricsAdvisorAdministrationClient(
5051
public MetricsAdvisorClient GetMetricsAdvisorClient(bool useTokenCredential = false)
5152
{
5253
var endpoint = new Uri(TestEnvironment.MetricsAdvisorUri);
53-
var instrumentedOptions = InstrumentClientOptions(new MetricsAdvisorClientsOptions());
54+
var instrumentedOptions = GetInstrumentedOptions();
5455

5556
MetricsAdvisorClient client = useTokenCredential
5657
? new(endpoint, TestEnvironment.Credential, instrumentedOptions)
@@ -88,5 +89,14 @@ protected void ValidateGroupKey(DimensionKey groupKey)
8889
Assert.That(column.Value, Is.Not.Null.And.Not.Empty);
8990
}
9091
}
92+
93+
private MetricsAdvisorClientsOptions GetInstrumentedOptions()
94+
{
95+
var options = new MetricsAdvisorClientsOptions();
96+
97+
options.Retry.MaxRetries = 6;
98+
99+
return InstrumentClientOptions(options);
100+
}
91101
}
92102
}

sdk/metricsadvisor/Azure.AI.MetricsAdvisor/tests/Samples/Sample04_HookCrudOperations.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public async Task UpdateHookAsync()
122122
}
123123

124124
[Test]
125+
[Ignore("https://github.com/Azure/azure-sdk-for-net/issues/20677")]
125126
public async Task GetHooksAsync()
126127
{
127128
string endpoint = MetricsAdvisorUri;

0 commit comments

Comments
 (0)