Fixes #23990
After #23799, the --failfast option in the test runner for the functional tests stopped working, because a second outer loop was introduced, which would have needed a break too for the test runner to fail immediately. This also led to the errors reported in #23990.
This provides a straightforward fix for that. There is also #23995 which is a larger refactor, but that hasn't been updated in a while to fix the failfast issue.