@@ -49,15 +49,19 @@ public TextAnalyticsClient GetClient(
4949 ? TestEnvironment . StaticEndpoint
5050 : TestEnvironment . Endpoint ) ;
5151
52+ TextAnalyticsAudience audience = TestEnvironment . GetAudience ( ) ;
53+
5254 options ??= new TextAnalyticsClientOptions ( ServiceVersion )
5355 {
54- Audience = TestEnvironment . GetAudience ( )
56+ Audience = audience
5557 } ;
5658
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 )
6165 {
6266 options . Retry . MaxRetries = MaxRetriesCount ;
6367 }
@@ -80,7 +84,7 @@ public TextAnalyticsClient GetClient(
8084
8185 // This has been added to stop the custom tests to run forever while we
8286 // 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
8488 internal static async Task PollUntilTimeout < T > ( Operation < T > operation , int timeoutInMinutes = 20 )
8589 {
8690 TimeSpan pollingInterval = TimeSpan . FromSeconds ( 10 ) ;
0 commit comments