xvfb parallel run on same node inside Jenkins

Issue

This Content is from Stack Overflow. Question asked by Vayas Zsolt Marton

I configured the UI automation tests (serenity+cucumber) to run in parallel.

Some of the tests fails randomly on the server where the xvfb display plugin is used. The tests are running all right locally with regular browser. The tests are running all good in case are executed sequence way (one by one).

The tests are failing because some elements cannot be find on the screen. The capture screenshots shows those elements.

I think the problem is coming from the xvfb plugin. The server starts at the beginning:

Xvfb starting$ /usr/bin//Xvfb -displayfd 2 -screen 0 1920x1080x24 -fbdir /opt/jenkins/xvfb-263-..fbdir2220451985689606010 -a

I think the cause is some multithreading issue. The different threads are using the same xvfb server with on display configuration. Should I configure each thread to use his dedicated Xvfb display?
If yes then how can I configure to create multiple displays at the beginning of the test and allocate them to each thread?



Solution

Check the Answers

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?