[tests] Add more special cases for random network errors on CI. (#12879)

Ref: https://github.com/xamarin/maccore/issues/2304
This commit is contained in:
Rolf Bjarne Kvinge 2021-10-01 08:36:40 +02:00 коммит произвёл GitHub
Родитель 26771dfefa
Коммит 4c9e2668b5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -566,7 +566,7 @@ namespace MonoTests.System.Net.Http
if (!done) { // timeouts happen in the bots due to dns issues, connection issues etc.. we do not want to fail
Assert.Inconclusive ("Request timedout.");
} else {
if (httpStatus == HttpStatusCode.BadGateway)
if (httpStatus == HttpStatusCode.BadGateway || httpStatus == HttpStatusCode.GatewayTimeout)
TestRuntime.IgnoreInCI ("Transient network failure - ignore in CI");
Assert.IsNull (ex, "Exception not null");
Assert.AreEqual (expectedStatus, httpStatus, "Status not ok");
@ -606,7 +606,7 @@ namespace MonoTests.System.Net.Http
if (!done) { // timeouts happen in the bots due to dns issues, connection issues etc.. we do not want to fail
Assert.Inconclusive ("First request timedout.");
} else {
if (httpStatus == HttpStatusCode.BadGateway)
if (httpStatus == HttpStatusCode.BadGateway || httpStatus == HttpStatusCode.GatewayTimeout)
TestRuntime.IgnoreInCI ("Transient network failure - ignore in CI");
Assert.IsNull (ex, "First request exception not null");
Assert.AreEqual (HttpStatusCode.OK, httpStatus, "First status not ok");
@ -637,7 +637,7 @@ namespace MonoTests.System.Net.Http
if (!done) { // timeouts happen in the bots due to dns issues, connection issues etc.. we do not want to fail
Assert.Inconclusive ("Second request timedout.");
} else {
if (httpStatus == HttpStatusCode.BadGateway)
if (httpStatus == HttpStatusCode.BadGateway || httpStatus == HttpStatusCode.GatewayTimeout)
TestRuntime.IgnoreInCI ("Transient network failure - ignore in CI");
Assert.IsNull (ex, "Second request exception not null");
Assert.AreEqual (HttpStatusCode.Unauthorized, httpStatus, "Second status not ok");