mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix intermittent failure in Subscribe_test:
Fixes: RIPD-1601 Fix intermittent failure in server stream sub/unsub test. Root cause is LoadManager thread *sometimes* running and causing a fee change event which got published before our test could unsubscribe. Fixed by explicitly stopping the LoadManager for this test.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/app/main/LoadManager.h>
|
||||
#include <ripple/app/misc/LoadFeeTrack.h>
|
||||
#include <ripple/app/misc/NetworkOPs.h>
|
||||
#include <ripple/core/ConfigSections.h>
|
||||
@@ -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()) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user