Skip to content

Commit

Permalink
fixup! ping: Make tests that verify current behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
xim committed Oct 2, 2023
1 parent b7a4368 commit f286669
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/beast/websocket/ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class ping_test : public websocket_test_suite
stream<test::stream> ws{ioc_};
ws.set_option(stream_base::timeout{
stream_base::none(),
std::chrono::milliseconds(200),
std::chrono::milliseconds(400),
true
});
unsigned n_pongs = 0;
Expand All @@ -148,8 +148,8 @@ class ping_test : public websocket_test_suite
ws.async_read(b, test::fail_handler(asio::error::operation_aborted));
// We are connected, base state
test::run_for(ioc_, std::chrono::seconds(1));
// About a second later, we should have close to 10 pings/pongs, and no timeout
BEAST_EXPECT(7 < n_pongs && n_pongs <= 10);
// About a second later, we should have close to 5 pings/pongs, and no timeout
BEAST_EXPECTS(3 <= n_pongs && n_pongs <= 5, "Unexpected nr of pings: " + std::to_string(n_pongs));
}
}

Expand Down

0 comments on commit f286669

Please sign in to comment.