Refactor tests to avoid the "port is already used" errors on the tests runner