Don't assert(...) with side effects
Summary:
This diffs fixes the assertions introduced in D3232 and adds a linter to
avoid reproducing the issue.
The fix is a backport of core PR14088
https://github.com/bitcoin/bitcoin/pull/14088/files
The linter is based on the second commit, but integrated into arcanist.
Test Plan:
./src/test/test_bitcoin -t scheduler_tests
Revert the changes in scheduler_tests and run:
arc lint -- src/test/scheduler_tests.cpp
The linter should catch the errors
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D3277