mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 09:58:14 +00:00
fix(ci): spark-lineage - select mock server port dynamically for unit test (#4018)
This commit is contained in:
parent
faac911df8
commit
4c33124e8f
@ -39,6 +39,7 @@ import org.mockserver.integration.ClientAndServer;
|
||||
import org.mockserver.matchers.Times;
|
||||
import org.mockserver.model.HttpResponse;
|
||||
import org.mockserver.model.JsonBody;
|
||||
import org.mockserver.socket.PortFactory;
|
||||
import org.mockserver.verify.VerificationTimes;
|
||||
import org.testcontainers.containers.PostgreSQLContainer;
|
||||
|
||||
@ -64,7 +65,8 @@ public class TestSparkJobsLineage {
|
||||
|
||||
private static final int N = 3; // num of GMS requests per spark job
|
||||
|
||||
private static final int GMS_PORT = MOCK_GMS ? 8089 : 8080;
|
||||
private static final int MOCK_PORT = PortFactory.findFreePort();
|
||||
private static final int GMS_PORT = MOCK_GMS ? MOCK_PORT : 8080;
|
||||
|
||||
private static final String EXPECTED_JSON_ROOT = "src/test/resources/expected/";
|
||||
@ClassRule
|
||||
@ -101,7 +103,7 @@ public class TestSparkJobsLineage {
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
mockServer = startClientAndServer();
|
||||
mockServer = startClientAndServer(GMS_PORT);
|
||||
resetBaseExpectations();
|
||||
}
|
||||
|
||||
@ -434,4 +436,4 @@ public class TestSparkJobsLineage {
|
||||
closed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user