Heh, yeah, I don't like those extra logic steps just to print a seemingly nicer error message. Seems harder to read the code then. Also, when it fails, it is already clear that the timeout is due the the stall not happening:
./bld-cmake/test/functional/interface_http.py", line 851, in check_slow_read_throttle
self.wait_until(progress_stalled, check_interval=5)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
./test/functional/test_framework/util.py", line 451, in wait_until_helper_internal
raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
...
Seems like a common pattern used in all tests.
Also, when a test fails, one has to fully understand the test code and source code anyway, so trying to make the error messages minimally nicer probably doesn't help with that.