@@ -49,15 +49,19 @@ public TextAnalyticsClient GetClient(
49
49
? TestEnvironment . StaticEndpoint
50
50
: TestEnvironment . Endpoint ) ;
51
51
52
+ TextAnalyticsAudience audience = TestEnvironment . GetAudience ( ) ;
53
+
52
54
options ??= new TextAnalyticsClientOptions ( ServiceVersion )
53
55
{
54
- Audience = TestEnvironment . GetAudience ( )
56
+ Audience = audience
55
57
} ;
56
58
57
- // While we use a persistent resource for live tests, we need to increase our retries.
58
- // We should remove when having dynamic resource again
59
- // Issue: https://github.com/Azure/azure-sdk-for-net/issues/25041
60
- if ( useStaticResource )
59
+ // We have seen transient timeouts while testing the custom text analysis features which are potentially
60
+ // related to the use of the static resource.
61
+ // TODO: https://github.com/Azure/azure-sdk-for-net/issues/25041.
62
+ // Similarly, we have also seen transient timeouts when running tests in the China cloud regions which are
63
+ // likely due to the physical distance between those regions and our CI infrastructure running in the US.
64
+ if ( useStaticResource || audience == TextAnalyticsAudience . AzureChina )
61
65
{
62
66
options . Retry . MaxRetries = MaxRetriesCount ;
63
67
}
@@ -80,7 +84,7 @@ public TextAnalyticsClient GetClient(
80
84
81
85
// This has been added to stop the custom tests to run forever while we
82
86
// get more reliable information on which scenarios cause timeouts.
83
- // Issue https://github.com/Azure/azure-sdk-for-net/issues/25152
87
+ // TODO: https://github.com/Azure/azure-sdk-for-net/issues/25152
84
88
internal static async Task PollUntilTimeout < T > ( Operation < T > operation , int timeoutInMinutes = 20 )
85
89
{
86
90
TimeSpan pollingInterval = TimeSpan . FromSeconds ( 10 ) ;
0 commit comments