You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stefan Bodewig <bo...@apache.org> on 2010/11/19 17:08:21 UTC
[lang3] Test Fail in Headless Mode (at Least on a Mac)
Hi,
I'm pretty sure lang3 isn't the only project that is affected, it's just
the first one we've seen it. "we" ist the Gump project.
Sander has set up a Mac to run Gump[1] and commons-lang3 is Gump's
guinea pig for Maven 3.x builds in the workspace we use for developer
tests and new installations.
The commons-lang3 builds fail[2] and too me it looks as if this was
because AWT is not running in headless mode, this in [3] looks
suspicious:
java.lang.InternalError: Can't connect to window server - not enough permissions.
As can be seen in [2] MAVEN_OPTS is set up to make mvn run in headless
mode but it doesn't affect the tests - likely because the tests run in a
forked VM and the same property must be set in the surefire
configuration.
I am suprised the problem doesn't show up in the other CI builds.
There likely is a way we could set additional properties for the maven
run (like surefire specific system properties or telling it not to
fork), but (a) this is beyond my Maven foo and (b) would have to be
repeated in other environments that have the same problem as well. Does
anybody know of a better fix?
Stefan
[1] http://adam.apache.org/gump/
[2] http://adam.apache.org/gump/commons-lang-3.x/commons-lang3/gump_work/build_commons-lang-3.x_commons-lang3.html
[3] http://adam.apache.org/gump/commons-lang-3.x/commons-lang3/gump_file/org.apache.commons.lang3.event.EventUtilsTest.txt.html
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by Henri Yandell <fl...@gmail.com>.
+1 to make a change; it really irritates on OS X when AWT takes over
control of the focus.
On Fri, Nov 19, 2010 at 8:08 AM, Stefan Bodewig <bo...@apache.org> wrote:
> Hi,
>
> I'm pretty sure lang3 isn't the only project that is affected, it's just
> the first one we've seen it. "we" ist the Gump project.
>
> Sander has set up a Mac to run Gump[1] and commons-lang3 is Gump's
> guinea pig for Maven 3.x builds in the workspace we use for developer
> tests and new installations.
>
> The commons-lang3 builds fail[2] and too me it looks as if this was
> because AWT is not running in headless mode, this in [3] looks
> suspicious:
>
> java.lang.InternalError: Can't connect to window server - not enough permissions.
>
> As can be seen in [2] MAVEN_OPTS is set up to make mvn run in headless
> mode but it doesn't affect the tests - likely because the tests run in a
> forked VM and the same property must be set in the surefire
> configuration.
>
> I am suprised the problem doesn't show up in the other CI builds.
>
> There likely is a way we could set additional properties for the maven
> run (like surefire specific system properties or telling it not to
> fork), but (a) this is beyond my Maven foo and (b) would have to be
> repeated in other environments that have the same problem as well. Does
> anybody know of a better fix?
>
> Stefan
>
> [1] http://adam.apache.org/gump/
>
> [2] http://adam.apache.org/gump/commons-lang-3.x/commons-lang3/gump_work/build_commons-lang-3.x_commons-lang3.html
>
> [3] http://adam.apache.org/gump/commons-lang-3.x/commons-lang3/gump_file/org.apache.commons.lang3.event.EventUtilsTest.txt.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by Henri Yandell <fl...@gmail.com>.
On Wed, Dec 1, 2010 at 7:57 AM, Matt Benson <gu...@gmail.com> wrote:
>
> On Dec 1, 2010, at 2:45 AM, Stefan Bodewig wrote:
>
>> On 2010-12-01, Henri Yandell wrote:
>>
>>> I've fixed this in r1040879.
>>
>> I can confirm it is fixed for Gump as well. I removed all awt.headless
>> settings from the Gump descriptor and the build still passes on adam.
>>
>
> Having thought I was following this thread, being an OSX user, and having worked in the event package I can only apologize for having apparently skimmed over the part of the thread that revealed that this is where the fault was. Thanks for fixing this, Hen.
>
> -Matt
No prob, gives me something to do :)
Hen
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by Matt Benson <gu...@gmail.com>.
On Dec 1, 2010, at 2:45 AM, Stefan Bodewig wrote:
> On 2010-12-01, Henri Yandell wrote:
>
>> I've fixed this in r1040879.
>
> I can confirm it is fixed for Gump as well. I removed all awt.headless
> settings from the Gump descriptor and the build still passes on adam.
>
Having thought I was following this thread, being an OSX user, and having worked in the event package I can only apologize for having apparently skimmed over the part of the thread that revealed that this is where the fault was. Thanks for fixing this, Hen.
-Matt
> Thanks!
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-12-01, Henri Yandell wrote:
> I've fixed this in r1040879.
I can confirm it is fixed for Gump as well. I removed all awt.headless
settings from the Gump descriptor and the build still passes on adam.
Thanks!
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by Henri Yandell <fl...@gmail.com>.
On Fri, Nov 26, 2010 at 12:49 AM, Henri Yandell <fl...@gmail.com> wrote:
> On Wed, Nov 24, 2010 at 3:51 AM, sebb <se...@gmail.com> wrote:
>> On 24 November 2010 11:02, Stefan Bodewig <bo...@apache.org> wrote:
>>> On 2010-11-24, sebb wrote:
>>>
>>>> On 24 November 2010 09:46, Stefan Bodewig <bo...@apache.org> wrote:
>>>>> On 2010-11-22, Jörg Schaible wrote:
>>>
>>>>>> Stefan Bodewig wrote:
>>>
>>>>>>> The commons-lang3 builds fail[2] and too me it looks as if this was
>>>>>>> because AWT is not running in headless mode,
>>>
>>>>> confirmed by passing -DargLine=-Djava.awt.headless=true to mvn - the
>>>>> builds now pass.
>>>
>>>>>>> I am suprised the problem doesn't show up in the other CI builds.
>>>
>>>>> Still surprised 8-)
>>>
>>>>> It doesn't show up inside Gump on Linux or FreeBSD running OpenJDK or
>>>>> the FreeBSD port of Sun's VM either - maybe this codebase's AWT detects
>>>>> there is no X-Server and switches to headless mode without any help.
>>>
>>>> Or are those nodes running a frame buffer (I think that is the correct name)?
>>>
>>> I don't recall installing Xvfb (the X server running in a virtual frame
>>> buffer) but it could have been pulled in as a dependency - and I'm
>>> pretty sure we don't start it even if it is installed. No, I don't
>>> think the builds have any X server to connect to.
>>>
>>>> Since there are headless hosts, maybe code which is supposed to be
>>>> able to run anywhere (e.g. LANG) needs to take this into account?
>>>
>>>> I.e. Perhaps MacGump has found a bug in Lang?
>>>
>>> The tests that failed are the ones for the event package. I don't see
>>> any uses of AWT in the main code but the tests use AWT classes
>>> (ActionEvent and ActionListener). It seems as if the static initializer
>>> of either class already requires a working window system on a Mac - it
>>> may not be required on OpenJDK's AWT.
>>>
>>> I don't think the lang3 code requires a window system - so no bug in the
>>> main code - but its tests do.
>>
>> IMO the tests should then be fixed (I may have time to look later).
>>
>> If there is a suitable alternative to the AWT events then use that,
>> otherwise allow for the test failure when running headless.
>>
>> Seems to me it's more useful for Gump to point out these problems than
>> to try and hide them.
>
> +1.
>
> Perhaps:
>
> javax.naming.event.ObjectChangeListener
> javax.naming.event.NamingEvent
I've fixed this in r1040879. Generally I opted for using java.beans listeners.
Hen
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by Henri Yandell <fl...@gmail.com>.
On Wed, Nov 24, 2010 at 3:51 AM, sebb <se...@gmail.com> wrote:
> On 24 November 2010 11:02, Stefan Bodewig <bo...@apache.org> wrote:
>> On 2010-11-24, sebb wrote:
>>
>>> On 24 November 2010 09:46, Stefan Bodewig <bo...@apache.org> wrote:
>>>> On 2010-11-22, Jörg Schaible wrote:
>>
>>>>> Stefan Bodewig wrote:
>>
>>>>>> The commons-lang3 builds fail[2] and too me it looks as if this was
>>>>>> because AWT is not running in headless mode,
>>
>>>> confirmed by passing -DargLine=-Djava.awt.headless=true to mvn - the
>>>> builds now pass.
>>
>>>>>> I am suprised the problem doesn't show up in the other CI builds.
>>
>>>> Still surprised 8-)
>>
>>>> It doesn't show up inside Gump on Linux or FreeBSD running OpenJDK or
>>>> the FreeBSD port of Sun's VM either - maybe this codebase's AWT detects
>>>> there is no X-Server and switches to headless mode without any help.
>>
>>> Or are those nodes running a frame buffer (I think that is the correct name)?
>>
>> I don't recall installing Xvfb (the X server running in a virtual frame
>> buffer) but it could have been pulled in as a dependency - and I'm
>> pretty sure we don't start it even if it is installed. No, I don't
>> think the builds have any X server to connect to.
>>
>>> Since there are headless hosts, maybe code which is supposed to be
>>> able to run anywhere (e.g. LANG) needs to take this into account?
>>
>>> I.e. Perhaps MacGump has found a bug in Lang?
>>
>> The tests that failed are the ones for the event package. I don't see
>> any uses of AWT in the main code but the tests use AWT classes
>> (ActionEvent and ActionListener). It seems as if the static initializer
>> of either class already requires a working window system on a Mac - it
>> may not be required on OpenJDK's AWT.
>>
>> I don't think the lang3 code requires a window system - so no bug in the
>> main code - but its tests do.
>
> IMO the tests should then be fixed (I may have time to look later).
>
> If there is a suitable alternative to the AWT events then use that,
> otherwise allow for the test failure when running headless.
>
> Seems to me it's more useful for Gump to point out these problems than
> to try and hide them.
+1.
Perhaps:
javax.naming.event.ObjectChangeListener
javax.naming.event.NamingEvent
Hen
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by sebb <se...@gmail.com>.
On 24 November 2010 11:02, Stefan Bodewig <bo...@apache.org> wrote:
> On 2010-11-24, sebb wrote:
>
>> On 24 November 2010 09:46, Stefan Bodewig <bo...@apache.org> wrote:
>>> On 2010-11-22, Jörg Schaible wrote:
>
>>>> Stefan Bodewig wrote:
>
>>>>> The commons-lang3 builds fail[2] and too me it looks as if this was
>>>>> because AWT is not running in headless mode,
>
>>> confirmed by passing -DargLine=-Djava.awt.headless=true to mvn - the
>>> builds now pass.
>
>>>>> I am suprised the problem doesn't show up in the other CI builds.
>
>>> Still surprised 8-)
>
>>> It doesn't show up inside Gump on Linux or FreeBSD running OpenJDK or
>>> the FreeBSD port of Sun's VM either - maybe this codebase's AWT detects
>>> there is no X-Server and switches to headless mode without any help.
>
>> Or are those nodes running a frame buffer (I think that is the correct name)?
>
> I don't recall installing Xvfb (the X server running in a virtual frame
> buffer) but it could have been pulled in as a dependency - and I'm
> pretty sure we don't start it even if it is installed. No, I don't
> think the builds have any X server to connect to.
>
>> Since there are headless hosts, maybe code which is supposed to be
>> able to run anywhere (e.g. LANG) needs to take this into account?
>
>> I.e. Perhaps MacGump has found a bug in Lang?
>
> The tests that failed are the ones for the event package. I don't see
> any uses of AWT in the main code but the tests use AWT classes
> (ActionEvent and ActionListener). It seems as if the static initializer
> of either class already requires a working window system on a Mac - it
> may not be required on OpenJDK's AWT.
>
> I don't think the lang3 code requires a window system - so no bug in the
> main code - but its tests do.
IMO the tests should then be fixed (I may have time to look later).
If there is a suitable alternative to the AWT events then use that,
otherwise allow for the test failure when running headless.
Seems to me it's more useful for Gump to point out these problems than
to try and hide them.
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-11-24, sebb wrote:
> On 24 November 2010 09:46, Stefan Bodewig <bo...@apache.org> wrote:
>> On 2010-11-22, Jörg Schaible wrote:
>>> Stefan Bodewig wrote:
>>>> The commons-lang3 builds fail[2] and too me it looks as if this was
>>>> because AWT is not running in headless mode,
>> confirmed by passing -DargLine=-Djava.awt.headless=true to mvn - the
>> builds now pass.
>>>> I am suprised the problem doesn't show up in the other CI builds.
>> Still surprised 8-)
>> It doesn't show up inside Gump on Linux or FreeBSD running OpenJDK or
>> the FreeBSD port of Sun's VM either - maybe this codebase's AWT detects
>> there is no X-Server and switches to headless mode without any help.
> Or are those nodes running a frame buffer (I think that is the correct name)?
I don't recall installing Xvfb (the X server running in a virtual frame
buffer) but it could have been pulled in as a dependency - and I'm
pretty sure we don't start it even if it is installed. No, I don't
think the builds have any X server to connect to.
> Since there are headless hosts, maybe code which is supposed to be
> able to run anywhere (e.g. LANG) needs to take this into account?
> I.e. Perhaps MacGump has found a bug in Lang?
The tests that failed are the ones for the event package. I don't see
any uses of AWT in the main code but the tests use AWT classes
(ActionEvent and ActionListener). It seems as if the static initializer
of either class already requires a working window system on a Mac - it
may not be required on OpenJDK's AWT.
I don't think the lang3 code requires a window system - so no bug in the
main code - but its tests do.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by sebb <se...@gmail.com>.
On 24 November 2010 09:46, Stefan Bodewig <bo...@apache.org> wrote:
> On 2010-11-22, Jörg Schaible wrote:
>
>> Stefan Bodewig wrote:
>
>>> The commons-lang3 builds fail[2] and too me it looks as if this was
>>> because AWT is not running in headless mode,
>
> confirmed by passing -DargLine=-Djava.awt.headless=true to mvn - the
> builds now pass.
>
>>> I am suprised the problem doesn't show up in the other CI builds.
>
> Still surprised 8-)
>
> It doesn't show up inside Gump on Linux or FreeBSD running OpenJDK or
> the FreeBSD port of Sun's VM either - maybe this codebase's AWT detects
> there is no X-Server and switches to headless mode without any help.
Or are those nodes running a frame buffer (I think that is the correct name)?
I seem to remember problems with running JMeter on Gump originally,
and that was one of the options.
[JMeter builds now include the option to run headless]
>>> There likely is a way we could set additional properties for the maven
>>> run (like surefire specific system properties or telling it not to
>>> fork), but (a) this is beyond my Maven foo and (b) would have to be
>>> repeated in other environments that have the same problem as well. Does
>>> anybody know of a better fix?
>
>> a) is:
>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-surefire-plugin</artifactId>
>> <configuration>
>> <forkMode>once</forkMode><!-- at least once -->
>> <systemProperties>
>> <property>
>> <name>java.awt.headless</name>
>> <value>true</value>
>> </property>
>> </systemProperties>
>> </configuration>
>> </plugin>
>
> Which would mean I'd have to modify the POM. Gump shouldn't do that and
> I don't feel I should fiddle with the POMs of projects that I'm not an
> active developer of.
Since there are headless hosts, maybe code which is supposed to be
able to run anywhere (e.g. LANG) needs to take this into account?
I.e. Perhaps MacGump has found a bug in Lang?
> Setting surefire's argLine will help Gump but will become tiresome if it
> happens for more than one project.
>
>> the question is if it should be added to the parent for all commons in
>> general or as a setting for lang only?
>
> I'm pretty sure there are other commons components who's tests will use
> parts of AWT so I'd be +1 on putting it into the parent.
See above - it might be better to fix the projects that don't work in
headless mode.
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-11-22, Jörg Schaible wrote:
> Stefan Bodewig wrote:
>> The commons-lang3 builds fail[2] and too me it looks as if this was
>> because AWT is not running in headless mode,
confirmed by passing -DargLine=-Djava.awt.headless=true to mvn - the
builds now pass.
>> I am suprised the problem doesn't show up in the other CI builds.
Still surprised 8-)
It doesn't show up inside Gump on Linux or FreeBSD running OpenJDK or
the FreeBSD port of Sun's VM either - maybe this codebase's AWT detects
there is no X-Server and switches to headless mode without any help.
>> There likely is a way we could set additional properties for the maven
>> run (like surefire specific system properties or telling it not to
>> fork), but (a) this is beyond my Maven foo and (b) would have to be
>> repeated in other environments that have the same problem as well. Does
>> anybody know of a better fix?
> a) is:
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <configuration>
> <forkMode>once</forkMode><!-- at least once -->
> <systemProperties>
> <property>
> <name>java.awt.headless</name>
> <value>true</value>
> </property>
> </systemProperties>
> </configuration>
> </plugin>
Which would mean I'd have to modify the POM. Gump shouldn't do that and
I don't feel I should fiddle with the POMs of projects that I'm not an
active developer of.
Setting surefire's argLine will help Gump but will become tiresome if it
happens for more than one project.
> the question is if it should be added to the parent for all commons in
> general or as a setting for lang only?
I'm pretty sure there are other commons components who's tests will use
parts of AWT so I'd be +1 on putting it into the parent.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [lang3] Test Fail in Headless Mode (at Least on a Mac)
Posted by Jörg Schaible <jo...@scalaris.com>.
Stefan Bodewig wrote:
> Hi,
>
> I'm pretty sure lang3 isn't the only project that is affected, it's just
> the first one we've seen it. "we" ist the Gump project.
>
> Sander has set up a Mac to run Gump[1] and commons-lang3 is Gump's
> guinea pig for Maven 3.x builds in the workspace we use for developer
> tests and new installations.
>
> The commons-lang3 builds fail[2] and too me it looks as if this was
> because AWT is not running in headless mode, this in [3] looks
> suspicious:
>
> java.lang.InternalError: Can't connect to window server - not enough
> permissions.
>
> As can be seen in [2] MAVEN_OPTS is set up to make mvn run in headless
> mode but it doesn't affect the tests - likely because the tests run in a
> forked VM and the same property must be set in the surefire
> configuration.
>
> I am suprised the problem doesn't show up in the other CI builds.
>
> There likely is a way we could set additional properties for the maven
> run (like surefire specific system properties or telling it not to
> fork), but (a) this is beyond my Maven foo and (b) would have to be
> repeated in other environments that have the same problem as well. Does
> anybody know of a better fix?
a) is:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>once</forkMode><!-- at least once -->
<systemProperties>
<property>
<name>java.awt.headless</name>
<value>true</value>
</property>
</systemProperties>
</configuration>
</plugin>
the question is if it should be added to the parent for all commons in
general or as a setting for lang only?
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org