Make sure the test clean up global status and work regardless of their e...

...xecution order

Backport from Master/6411df5e7e