Close realms in tests