Launching tests without Display raises "org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]"

2,226 views
Skip to first unread message

Pedro Santos Gomez

unread,
Oct 13, 2007, 11:53:04 AM10/13/07
to Google-We...@googlegroups.com
Hi!

I'm experiencing problems when trying to run my tests
automatically in a CruiseControl machine under Ubuntu
Dapper when the user running CruiseControl doesn't
have any X session opened. In my Ubuntu Feisty laptop
occurs just the same when $DISPLAY points to something
wrong:

"""
user@machine:~/version3/client$
DISPLAY=this.does.not.exist
user@machine:~/version3/client$ ant -f
SampleProjectClient.ant.xml test
Buildfile: SampleProjectClient.ant.xml

compile:

test:
[junit] Running
pack.age.SampleProject.client.experiments.ExperimentFactoryTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time
elapsed: 0,542 sec
[junit] Testsuite:
pack.age.SampleProject.client.experiments.ExperimentFactoryTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time
elapsed: 0,542 sec

[junit] Testcase: testWrongExperimentID took 0,262
sec
[junit] Caused an ERROR
[junit] No more handles [gtk_init_check() failed]
[junit] org.eclipse.swt.SWTError: No more handles
[gtk_init_check() failed]
[junit] at
org.eclipse.swt.SWT.error(SWT.java:3400)
[junit] at
org.eclipse.swt.widgets.Display.createDisplay(Display.java:793)
[junit] at
org.eclipse.swt.widgets.Display.create(Display.java:781)
[junit] at
org.eclipse.swt.graphics.Device.<init>(Device.java:145)
[junit] at
org.eclipse.swt.widgets.Display.<init>(Display.java:452)
[junit] at
org.eclipse.swt.widgets.Display.<init>(Display.java:443)
[junit] at
org.eclipse.swt.widgets.Display.getDefault(Display.java:1522)
[junit] at
com.google.gwt.dev.GWTShell.<init>(GWTShell.java:330)
[junit] at
com.google.gwt.junit.JUnitShell.<init>(JUnitShell.java:251)
[junit] at
com.google.gwt.junit.JUnitShell.getUnitTestShell(JUnitShell.java:177)
[junit] at
com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:167)
[junit] at
com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:194)
[junit] at
com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:114)


BUILD FAILED
/home/user/proyectos/SampleProject/svn/SampleProject/version3/client/SampleProjectClient.ant.xml:25:
Test
pack.age.SampleProject.client.experiments.ExperimentFactoryTest
failed

Total time: 2 seconds
user@machine:~/version3/client$
"""

Can I launch the tests without running a graphical
environment (without using xvfb or whatever)?

Thank you very much in advance,

Pedro



____________________________________________________________________________________
Sé un Mejor Amante del Cine
¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
http://advision.webevents.yahoo.com/reto/entretenimiento.html

joerg.h...@googlemail.com

unread,
Oct 30, 2007, 9:03:58 AM10/30/07
to Google Web Toolkit
Hello,

I am having the same problem.
Any solutions for this problem (e.g. running a fake X-Server, patching
swt-libs, etc.)?
I thought the idea of the hidden Test-Shell is to be able to run such
tests as a Batch without such interference.

Regards
Jörg

ssylvis

unread,
Oct 31, 2007, 7:41:11 PM10/31/07
to Google Web Toolkit
I'm trying to do the same thing with Hudson (continuous integration
server) and was unsuccessful with headless servers, with and without X
installed.

When I tried running a simple GWTTestCase on a server without a
graphical environment installed, I got the following error:

Testcase: testEditor took 0.125 sec
Caused an ERROR
bin/gwt-1.4.60/libswt-pi-gtk-3235.so: libgtk-x11-2.0.so.0: cannot open
shared object file: No such file or directory
java.lang.UnsatisfiedLinkError: bin/gwt-1.4.60/libswt-pi-gtk-3235.so:
libgtk-x11-2.0.so.0: cannot open shared object file: No such file or
directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)
at java.lang.Runtime.load0(Runtime.java:769)
at java.lang.System.load(System.java:967)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:
132)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:
63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:
54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:126)
at com.google.gwt.dev.GWTShell.<clinit>(GWTShell.java:264)
at
com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:194)
at
com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:114)

And when I tried to run the same test on a headless server with X
installed, I got the following error:

Testcase: testEditor took 0.424 sec
Caused an ERROR


No more handles [gtk_init_check() failed]

at org.eclipse.swt.SWT.error(SWT.java:3400)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:
793)
at org.eclipse.swt.widgets.Display.create(Display.java:781)


at org.eclipse.swt.graphics.Device.<init>(Device.java:145)

at org.eclipse.swt.widgets.Display.<init>(Display.java:452)

at org.eclipse.swt.widgets.Display.<init>(Display.java:443)

at org.eclipse.swt.widgets.Display.getDefault(Display.java:
1522)


at com.google.gwt.dev.GWTShell.<init>(GWTShell.java:330)

at com.google.gwt.junit.JUnitShell.<init>(JUnitShell.java:251)

at
com.google.gwt.junit.JUnitShell.getUnitTestShell(JUnitShell.java:177)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:
167)
at
com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:194)
at
com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:114)

I would very much like to run a suite of GWT tests on a build server,
but it does not appear to be possible. Has anyone else been able to do
this? How does the GWT developer team run their regression tests?

On Oct 13, 8:53 am, Pedro Santos Gomez

Pedro Santos Gomez

unread,
Nov 1, 2007, 5:53:18 PM11/1/07
to Google-We...@googlegroups.com
Hi

I finally used Xvfb, adding the following lines to the script that starts cruisecontrol:

"""
Xvfb :1 -ac -screen 0 1024x768x8 &

export DISPLAY=:1

(...)
/usr/local/lib/cruisecontrol/cruisecontrol.sh (...)
"""

And it has been working as expected during the last two weeks.

> Regards
> Jörg

Regards,
Pedro



______________________________________________
Pregunta, Responde, Descubre.
Comparte tus consejos y opiniones con los usuarios de Yahoo! Respuestas
http://es.answers.yahoo.com/info/welcome

Reply all
Reply to author
Forward
0 new messages