I noticed the Peter's commit 7e3c54168d9ec058cb3c9d47f8105b1d32dc8ceb that stabilizes certain tests by adding ORDER BY clause in tests and remember that I saw the same error in tablespaces test for creation of partitioned index. It comes very rarely and test fails on inverted order of parent and child.
PFA small patch that stabilizes that test in the same style by adding ORDER BY.