QXcbConnection: Could not connect to display [Qt] [Jenkins]

2,558 views
Skip to first unread message

Niels Hesp

unread,
Aug 21, 2013, 3:15:57 AM8/21/13
to jenkins...@googlegroups.com
Hi everybody,

I’m having some problems implementing a simple GuiTest (that uses QTestLib) in Jenkins. In a terminal I can execute the following command:

./tst_testgui -xunitxml > testresult.xml

This command generates the following .xml file:

<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="0" failures="0" tests="3" name="TestGui">
 <properties>
   <property value="5.0.2" name="QTestVersion"/>
   <property value="5.0.2" name="QtVersion"/>
  </properties>
  <testcase result="pass" name="initTestCase"/>
  <testcase result="pass" name="testGui"/>
  <testcase result="pass" name="cleanupTestCase"/>
  <system-err/>
</testsuite>

In Jenkins I’m trying to do the same by executing the same command in an Execute Shell, but after building the project (works fine) and then executing de command:

./tst_testgui -xunitxml > testresult.xml

I get the following message in Jenkins:

+ ./tst_testgui -xunitxml
No protocol specified
QXcbConnection: Could not connect to display :0.0
Aborted (core dumped)
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Does somebody know what could be the problem?
I get the same message with the -xml command instead of -xunitxml.

Grtz. Niels

Dirk Heinrichs

unread,
Aug 21, 2013, 3:21:39 AM8/21/13
to jenkins...@googlegroups.com
Am 21.08.2013 09:15, schrieb Niels Hesp:
> Hi everybody,
>
> I�m having some problems implementing a simple GuiTest (that uses
> QTestLib) in Jenkins. In a terminal I can execute the following command:
>
> ./tst_testgui -xunitxml > testresult.xml
>
> This command generates the following .xml file:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <testsuite errors="0" failures="0" tests="3" name="TestGui">
> <properties>
> <property value="5.0.2" name="QTestVersion"/>
> <property value="5.0.2" name="QtVersion"/>
> </properties>
> <testcase result="pass" name="initTestCase"/>
> <testcase result="pass" name="testGui"/>
> <testcase result="pass" name="cleanupTestCase"/>
> <system-err/>
> </testsuite>
>
> In Jenkins I�m trying to do the same by executing the same command in
> an Execute Shell, but after building the project (works fine) and then
> executing de command:
>
> ./tst_testgui -xunitxml >testresult.xml
>
> I get the following message in Jenkins:
>
> + ./tst_testgui -xunitxml
> No protocol specified
> QXcbConnection: Could not connect to display :0.0
> Aborted (core dumped)
> Build step 'Execute shell' marked build as failure
> Finished: FAILURE
>
> Does somebody know what could be the problem?
> I get the same message with the -xml command instead of -xunitxml.

You need an X server on your Jenkins machine to run GUI programs. Have a
look at Xvfb.

HTH...

Dirk
--

*Dirk Heinrichs*, Senior Systems Engineer, Infrastructure
*Recommind GmbH*, Von-Liebig-Stra�e 1, 53359 Rheinbach
*Tel*: +49 2226 1596666 1149
*Email*: d...@recommind.com <mailto:d...@recommind.com>
*Skype*: dirk.heinrichs.recommind
www.recommind.com <http://www.recommind.com>


http://www.recommind.com

Niels Hesp

unread,
Aug 21, 2013, 5:32:35 AM8/21/13
to jenkins...@googlegroups.com
Hi Dirk,

first of all thanks for your reaction!
I managed to install and use xvfb.

I can use the command:

./tst_testgui -xunitxml > testresult.xml

and the build is successful.
But I get the following message at the end of the build:

Xlib:  extension "RANDR" missing on display ":1".

Is this a bug in xvfb?


Op woensdag 21 augustus 2013 09:15:57 UTC+2 schreef Niels Hesp:

Dirk Heinrichs

unread,
Aug 21, 2013, 5:38:54 AM8/21/13
to jenkins...@googlegroups.com
Am 21.08.2013 11:32, schrieb Niels Hesp:
> Xlib: extension "RANDR" missing on display ":1".
>
> Is this a bug in xvfb?

Don't know. RANDR is needed for rotating displays, so it shouldn't harm.
Maybe installing the extension (libxrandr2 on Debian/Ubuntu) will
eliminate the message.

Bye...

Niels Hesp

unread,
Aug 21, 2013, 5:49:47 AM8/21/13
to jenkins...@googlegroups.com, d...@recommind.com
libxrandr2 was already installed, so that didn't work.
But we don't need the RANDR function so we will ignore the message.

Thanks for your help!
My problem is SOLVED!!!

Op woensdag 21 augustus 2013 11:38:54 UTC+2 schreef Dirk Heinrichs:

Dirk Heinrichs

unread,
Aug 21, 2013, 7:18:39 AM8/21/13
to jenkins...@googlegroups.com
Am 21.08.2013 11:49, schrieb Niels Hesp:
> libxrandr2 was already installed, so that didn't work.
> But we don't need the RANDR function so we will ignore the message.

Just found this on stackoverflow.com, start Xvfb like so:
|Xvfb +extension RANDR

Bye...

Dirk
|
--

*Dirk Heinrichs*, Senior Systems Engineer, Infrastructure
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
Reply all
Reply to author
Forward
0 new messages