For the purpose of this test the two have the same outcome, but this one
is shorter and avoids a sleep for 0.1 seconds.
This is a backport of Core [[https://github.com/bitcoin/bitcoin/pull/18742 | PR18742]]
https://github.com/bitcoin/bitcoin/pull/18742/commits/fa5ceb25fce2200edf6b8ebfa6d4f01ed6774b95