mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 05:17:26 +02:00
Fix spurious race in websocket close test
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
Version 123:
|
Version 123:
|
||||||
|
|
||||||
* Use unit-test subtree
|
* Use unit-test subtree
|
||||||
|
* Fix spurious race in websocket close test
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -520,6 +520,9 @@ public:
|
|||||||
if(! ec)
|
if(! ec)
|
||||||
BEAST_EXPECT(to_string(b.data()) == s);
|
BEAST_EXPECT(to_string(b.data()) == s);
|
||||||
++count;
|
++count;
|
||||||
|
if(count == 4)
|
||||||
|
BEAST_EXPECT(
|
||||||
|
ec == boost::asio::error::operation_aborted);
|
||||||
});
|
});
|
||||||
ws.async_write(buffer(s),
|
ws.async_write(buffer(s),
|
||||||
[&](error_code ec, std::size_t n)
|
[&](error_code ec, std::size_t n)
|
||||||
@ -547,7 +550,8 @@ public:
|
|||||||
if(ec)
|
if(ec)
|
||||||
BOOST_THROW_EXCEPTION(
|
BOOST_THROW_EXCEPTION(
|
||||||
system_error{ec});
|
system_error{ec});
|
||||||
BEAST_EXPECT(++count == 2);
|
++count;
|
||||||
|
BEAST_EXPECT(count == 2 || count == 3);
|
||||||
});
|
});
|
||||||
BEAST_EXPECT(count == 0);
|
BEAST_EXPECT(count == 0);
|
||||||
ios.run();
|
ios.run();
|
||||||
|
Reference in New Issue
Block a user