[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:
Родитель
26771dfefa
Коммит
4c9e2668b5
|
@ -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");
|
||||
|
|
Загрузка…
Ссылка в новой задаче