mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 00:36:48 +00:00
fix: Fix flaky CI tests (#7005)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -3530,9 +3530,18 @@ public:
|
||||
jv.isMember(jss::load_factor_fee_reference) &&
|
||||
jv[jss::load_factor_fee_reference] == 256;
|
||||
}));
|
||||
|
||||
BEAST_EXPECT(
|
||||
!wsc->findMsg(1s, [&](auto const& jv) { return jv[jss::type] == "serverStatus"; }));
|
||||
// Drain any extra serverStatus messages that may arrive
|
||||
// asynchronously from the ledger close processing. The drain
|
||||
// is bounded so the test cannot hang if serverStatus keeps
|
||||
// arriving (e.g. LoadManager raising/lowering fees).
|
||||
auto const drainDeadline = std::chrono::steady_clock::now() + 5s;
|
||||
while (std::chrono::steady_clock::now() < drainDeadline)
|
||||
{
|
||||
if (!wsc->findMsg(1s, [&](auto const& jv) { return jv[jss::type] == "serverStatus"; }))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
auto jv = wsc->invoke("unsubscribe", stream);
|
||||
BEAST_EXPECT(jv[jss::status] == "success");
|
||||
|
||||
@@ -58,6 +58,17 @@ class PerfLog_test : public beast::unit_test::suite
|
||||
|
||||
explicit Fixture(Application& app, beast::Journal j) : app_(app), j_(j)
|
||||
{
|
||||
// Clean up any stale state from a previous test run. On
|
||||
// self-hosted CI runners the temp directory persists between
|
||||
// runs, so the "nasty file" test may have left a regular file
|
||||
// (or a non-empty directory) at the logDir path.
|
||||
//
|
||||
// The error code is intentionally ignored: if the path doesn't
|
||||
// exist (the common case on a clean runner) remove_all returns
|
||||
// an error, and that's fine — there's nothing to clean up.
|
||||
using namespace boost::filesystem;
|
||||
boost::system::error_code ec;
|
||||
remove_all(logDir(), ec);
|
||||
}
|
||||
|
||||
~Fixture()
|
||||
|
||||
Reference in New Issue
Block a user