Bitcoin's regtests are ordered roughly by runtime (longest running first) to aid in parallelism in test/functional/test_runner.py. This makes sense, but having the manually-ordered list in the script has two issues:
It is brittle and error prone, as whoever adds a new test has to judge where to put it. Also, when a test is changed in a way that affects the runtime, it is likely forgotten to reoder the list.
Having the list in a weird order makes it much less readable. In code, it should be ordered in a way that is logical for developers to write and read, with related tests next to each other.
I would like to make the ordering automatic. For this, we can just have a new data file (e. g., JSON or generated Python code) that has the runtime for each test, and then use this file to sort the list automatically before running any tests. This file should probably be checked into version control, but test_runner.py can have a new execution mode that not only prints the runtimes after the fact (which it already does) but also saves them to this file. That way, it will be easy to keep it updated, and no manual judging is required.
Please let me know what you think about this proposal - I would like to get feedback before I implement it, so that I can take that feedback into account and not waste my time.