Refactor test to avoid port conflicts