test: Global fixtures
This has been nagging me for a while, even if the impact is likely only minor, and only on a single configuration.
pytest allows fixtures to be reused across tests, by providing them with a scope. The scope=session would spin up the fixture on the first use, and shut it down only once the last test using it has completed. The problem is that with pytest-xdist the main process just enumerates tests and spawns workers, each in their own process. This also means that each fixture with scope session is also multiplied by the number of workers, because the workers cannot share fixtures among each other, living in different processes.
This plugin implements a global fixture, even when spawning and executing tests in workers. It does so by making the fixture negotiation an explicit step, and the coordinator (main process) is in charge of actually starting / managing / stopping fixtures.
We spawn a small RPC in the coordinator, and inherit the details to contact the RPC to the workers. The workers can then talk to the coordinator, ask for a fixture, and they get a configuration back from the shared fixture (usually just a DSN or other connection string to interact with the fixture).
This is used in our case, for postgres which we used to spawn a new instance of for each test, but since it has a way to serve multiple tenants, via separate schemas and databases, the global fixture just adds dbs and returns connection strings, and on free, the coordinator drops the fixture again.
It may only be sporadically used in CLN, but I found this incredibly useful in more advanced setups, where DB servers and Message Queues, etc must be added to the tests.