add test for Master server, optimize test for client