refine the code of sweeper test.