diff --git a/src/test/rpc/Subscribe_test.cpp b/src/test/rpc/Subscribe_test.cpp index b3dc646e7e..f041256c53 100644 --- a/src/test/rpc/Subscribe_test.cpp +++ b/src/test/rpc/Subscribe_test.cpp @@ -16,6 +16,7 @@ //============================================================================== #include +#include #include #include #include @@ -53,6 +54,12 @@ public: BEAST_EXPECT(jv[jss::status] == "success"); } + // here we forcibly stop the load manager because it can (rarely but + // every-so-often) cause fees to raise or lower AFTER we've called the + // first findMsg but BEFORE we unsubscribe, thus causing the final + // findMsg check to fail since there is one unprocessed ws msg created + // by the loadmanager + env.app().getLoadManager().onStop(); { // Raise fee to cause an update auto& feeTrack = env.app().getFeeTrack(); @@ -88,7 +95,8 @@ public: env.app().getOPs().reportFeeChange(); // Check stream update - BEAST_EXPECT(! wsc->getMsg(10ms)); + auto jvo = wsc->getMsg(10ms); + BEAST_EXPECTS(!jvo, "getMsg: " + to_string(jvo.get()) ); } }