Related to #14289 and follows up on #15205. See a relevant IRC chat here: http://www.erisian.com.au/bitcoin-core-dev/log-2019-01-22.html
This helps detect deadlocks in the scheduler (and by association validation interface callbacks) by adding a flag which causes the scheduler to execute tasks synchronously in the calling thread. It adds a Travis job that runs the functional test suite with this flag enabled.
You can verify that the flag works as intended by applying this diff
0diff --git a/src/test/validation_block_tests.cpp b/src/test/validation_block_tests.cpp
1index 44432cd0a1..bb4046f119 100644
2--- a/src/test/validation_block_tests.cpp
3+++ b/src/test/validation_block_tests.cpp
4@@ -27,6 +27,7 @@ struct TestSubscriber : public CValidationInterface {
5
6 void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload) override
7 {
8+ SyncWithValidationInterfaceQueue();
9 BOOST_CHECK_EQUAL(m_expected_tip, pindexNew->GetBlockHash());
10 }
rebuilding with ./configure ... CPPFLAGS="... -DDEBUG_SERIALIZE_SCHEDULER"
, then running ./src/test/test_bitcoin -t validation_block_tests
, and watching as the deadlock detector hulks out.