PostgisJNDIDataSource test (quietly) fails

Description

When excecuting PostGIS online tests via the Jenkins 'geotools-master-online' project, we get the following error:

Running org.geotools.data.postgis.PostgisJNDIDataSourceOnlineTest
javax.naming.ContextNotEmptyException
at org.osjava.sj.jndi.AbstractContext.destroySubcontext(AbstractContext.java:551)
at org.osjava.sj.jndi.AbstractContext.destroySubcontext(AbstractContext.java:561)
at javax.naming.InitialContext.destroySubcontext(InitialContext.java:475)
at org.osjava.sj.jndi.DelegatingContext.destroySubcontext(DelegatingContext.java:116)
at org.osjava.sj.loader.JndiLoader.jndiPut(JndiLoader.java:316)
at org.osjava.sj.loader.JndiLoader.load(JndiLoader.java:277)
at org.osjava.sj.loader.JndiLoader.loadDirectory(JndiLoader.java:156)
at org.osjava.sj.loader.JndiLoader.loadDirectory(JndiLoader.java:104)
at org.osjava.sj.SimpleContext.<init>(SimpleContext.java:98)
at org.osjava.sj.SimpleContextFactory.getInitialContext(SimpleContextFactory.java:69)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
at javax.naming.InitialContext.init(InitialContext.java:242)
at javax.naming.InitialContext.<init>(InitialContext.java:192)
at org.geotools.jdbc.JDBCJNDITestSetup.createDataSource(JDBCJNDITestSetup.java:92)
at org.geotools.jdbc.JDBCTestSetup.getDataSource(JDBCTestSetup.java:85)
at org.geotools.jdbc.JDBCTestSupport.isOnline(JDBCTestSupport.java:99)
at org.geotools.test.OnlineTestCase.checkAvailable(OnlineTestCase.java:144)
at org.geotools.test.OnlineTestCase.run(OnlineTestCase.java:122)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

This also causes the next call to JDBCTestSetup.isOnline to fail with a NPE, skipping the rest of the PostGIS tests:

Skipping postgis tests, resources not available: java.lang.NullPointerException

Moreover, because the tests are skipped, and all previous tests passed, it does not register as a test failure.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 3:28 PM

CodeHaus Comment From: bencaradocdavies - Time: Thu, 19 Feb 2015 14:03:08 -0600
---------------------
I do not see this failure on my platform. Running a clean install of this module with -Ponline gives amongst other things (and subsequent tests also run):

I am using postgresql-9.4 9.4.1-1 amd64 on debian/sid with:

codehaus
April 10, 2015, 3:28 PM

CodeHaus Comment From: tbarsballe - Time: Thu, 19 Feb 2015 14:09:07 -0600
---------------------
I am likewise unable to replicate it locally, I have only observed the issue on Jenkins.

The cause I can think of is that Jenkins is running on a different server than the database.

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Affects versions

Priority

Medium
Configure