diff --git a/src/test/app/SHAMapStore_test.cpp b/src/test/app/SHAMapStore_test.cpp index 61c965803d..6d570bff45 100644 --- a/src/test/app/SHAMapStore_test.cpp +++ b/src/test/app/SHAMapStore_test.cpp @@ -671,6 +671,9 @@ public: { std::this_thread::sleep_for(100ms); } + // Even the slowest machines should be able to finalize deleteSeq within 4 + // loops (400ms). If this test ever actually fails feel free to lower this + // cutoff. BEAST_EXPECTS(iterations > 25, to_string(iterations)); } lm.clearLedger(deleteSeq); @@ -699,8 +702,9 @@ public: // Close another ledger, which will trigger a rotation, but the // rotation will be stuck until the missing ledger is filled in. env.close(); - // DO NOT CALL rendezvous() without a timeout parameter! You'll end up with a - // deadlock. + // Do not call rendezvous() here without a timeout; it will block until the missing + // ledger is backfilled. That will not happen automatically. It's a manual step that + // is done later in this test. ++maxSeq; // Nothing has changed diff --git a/src/test/jtx/envconfig.h b/src/test/jtx/envconfig.h index a73652d461..4453ac041b 100644 --- a/src/test/jtx/envconfig.h +++ b/src/test/jtx/envconfig.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index a62a9b0f5d..f94bb18ff4 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -669,10 +670,10 @@ SHAMapStoreImp::healthWait() }; // Tracked server status properties - LedgerIndex index; + LedgerIndex index = 0; std::chrono::seconds age; - OperatingMode mode; - std::size_t numMissing; + OperatingMode mode = OperatingMode::DISCONNECTED; + std::size_t numMissing = 0; std::unique_lock lock(mutex_);