WebSocket test is deterministic

This commit is contained in:
Richard Hodges
2021-03-30 12:01:11 +02:00
parent b7344b0d50
commit 7257d64a21
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,7 @@
* WebSocket test is deterministic.
--------------------------------------------------------------------------------
Version 313:
* Fix incorrect websocket test ordering.

View File

@ -108,16 +108,17 @@ struct timer_test : unit_test::suite
ioc.restart();
flat_buffer b;
error_code ec1, ec2;
error_code ec2;
ws1.async_close({},
[&ec2](error_code ec)
{
ec2 = ec;
});
ioc.run();
BEAST_EXPECT(
ec1 == beast::error::timeout ||
ec2 == beast::error::timeout);
BEAST_EXPECTS(
ec2 == beast::error::timeout ||
ec2 == net::error::operation_aborted,
ec2.message());
}
{
net::io_context ioc;
@ -186,8 +187,8 @@ struct timer_test : unit_test::suite
void
run() override
{
testIdlePing();
testIssue1729();
testIdlePing();
testCloseWhileRead();
}
};