未验证 提交 bbaba101 编写于 作者: G github-actions[bot] 提交者: GitHub

[release/8.0] Add Retry and Task.Delay to WinHttpHandler...

[release/8.0] Add Retry and Task.Delay to WinHttpHandler AfterReadResponseServerError_ClientWrite test (#91271)

* Add Task.Delay to give more time for reset frame

* Apply James' solution

---------
Co-authored-by: NAhmet Ibrahim Aksoy (from Dev Box) <aaksoy@microsoft.com>
上级 8cc9e079
......@@ -143,7 +143,17 @@ public async Task AfterReadResponseServerError_ClientWrite()
// Server sends RST_STREAM.
await connection.WriteFrameAsync(new RstStreamFrame(FrameFlags.EndStream, 0, streamId));
await Assert.ThrowsAsync<IOException>(() => requestStream.WriteAsync(new byte[50]).AsTask());
await Assert.ThrowsAsync<IOException>(async () =>
{
for (int i = 0; i < 10; i++)
{
await requestStream.WriteAsync(new byte[50]);
// WriteAsync succeeded because handler hasn't processed RST_STREAM yet.
// Small wait before trying again.
await Task.Delay(50);
}
});
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册