1

我在 Jenkins 中有一个可以执行并发构建的构建流程作业。作业的单个运行实例中的每个构建都可以运行多个 UI 测试,其中每个测试集都应在唯一的 Xvfb 端口上运行。我正在使用 Xvfb 插件。

从概念上讲:

Job1 and Job2 are 2 concurrent instance of a Build Flow job. There could be more.
Each of Job1 and Job2 can have concurrent running children, 
each of which is a Free Flow job that configures the Xvfb in it.

Job1 -------------| -Test set 1 (test_a, test_b etc. on Xvfb port 1) -> free flow instance 1@Job1
                  |
                  | -Test Set 2 (test_x, test_y etc. on Xvfb port 2) -> free flow instance 2@Job1
                  |
                  | -Test Set 3 (test_p, test_q etc. on Xvfb port 3) -> free flow instance 3@Job1
                  |
                  | -Test Set 4 (test_m, test_n etc. on Xvfb port 4) -> free flow instance 4@Job1

Job2 -------------| -Test set 1 (test_s, test_t etc. on Xvfb port 5) -> free flow instance 1@Job2
                  |
                  | -Test Set 2 (test_d, test_e etc. on Xvfb port 6) -> free flow instance 2@Job2
                  |
                  | -Test Set 3 (test_j, test_k etc. on Xvfb port 7) -> free flow instance 3@Job2

Xvfb 配置如下: 测试运行作业中的 Xvfb 配置

我遇到了很多端口冲突和引发错误的问题:

_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
20:51:06 _XSERVTransMakeAllCOTSServerListeners: server already running

有人可以告诉我如何配置 Xvfb,以便作业的每个运行实例占用一个唯一的显示/屏幕。

为了简化和总结,假设我有一个简单的 Jenkins 作业,它使用 Xvfb 显示端口来运行。而且,该作业可以同时作为多个实例运行。如何确保每个并发实例在唯一的 Xvfb 显示器上运行?

4

1 回答 1

1

聚会有点晚了,但在设置我的 Jenkins Xvfb 工作时遇到了这个问题。我的解决方案是添加一个运行时标志

xvfb-run -a

这将继续尝试显示端口,直到找到空闲端口。你可以在这里阅读更多。所以尝试在Xvfb additional options插件字段中添加标志。

于 2018-04-03T07:03:09.573 回答