Up to now, we've only worried about whether tests running in parallel within a single test suite can interact. It's quite scary to think that the meson setup has expanded the possibility of interactions to our entire source tree. Maybe that was a bad idea and we should fix the meson infrastructure to not do that. I fear that otherwise, we'll get bit regularly by very-low-probability bugs of this kind.
I have the same concern. I suspect that the scan of pg_prepared_xacts is not the only test that could cause problems when running in parallel to other tests from the entire source tree.