diff --git a/tests/Serval.E2ETests/ServalClientHelper.cs b/tests/Serval.E2ETests/ServalClientHelper.cs index d00e78c5..6a944910 100644 --- a/tests/Serval.E2ETests/ServalClientHelper.cs +++ b/tests/Serval.E2ETests/ServalClientHelper.cs @@ -21,7 +21,7 @@ public ServalClientHelper(string audience, string prefix = "SCE_", bool ignoreSS else _httpClient = new HttpClient(); _httpClient.BaseAddress = new Uri(env["hostUrl"]); - _httpClient.Timeout = TimeSpan.FromSeconds(10); + _httpClient.Timeout = TimeSpan.FromSeconds(60); dataFilesClient = new DataFilesClient(_httpClient); translationEnginesClient = new TranslationEnginesClient(_httpClient); _httpClient.DefaultRequestHeaders.Add( @@ -127,10 +127,11 @@ public async Task BuildEngine(string engineId) } revision = result.Revision; } - catch (TaskCanceledException e) + catch (ServalApiException e) { - if (!e.Message.Contains("canceled due to the configured HttpClient.Timeout")) + if (e.StatusCode != 408) throw; + // Throttle requests await Task.Delay(500); }