Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Use a default host name if localAddress is not available #7409

Closed
nrpeterson opened this issue Aug 22, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@nrpeterson
Copy link

commented Aug 22, 2014

I'm trying to do integration testing on an application backed by elasticsearch, and running in to trouble.

At this point, the specific test method that is being called is essentially empty; as a stub, it is

@ClusterScope(scope=Scope.SUITE, numNodes=1)
public class EsMappingTest extends ElasticsearchIntegrationTest {
    @Test
    public void testMappingForIndexContainer() {}
}

I receive the attached error when attempting to run that test; the strange thing is, it is not reproducible on other machines that we've tried, and continues to happen even when we use the JAR files compiled on those other machines. All other (non-elasticsearch) tests work perfectly well.

Here's the error:

JUnit version 4.10
E14/08/22 09:32:52 ERROR elasticsearch.test: FAILURE : com.lumiata.lumigraph.datastore.internal.elasticsearch.EsMappingTest
REPRODUCE WITH : mvn test -Dtests.seed=42012D4D1D344754 -Dtests.class=com.lumiata.lumigraph.datastore.internal.elasticsearch.EsMappingTest -Dtests.prefix=tests -Dfile.encoding=UTF-8 -Duser.timezone=America/Los_Angeles
Throwable:
java.lang.NullPointerException
__randomizedtesting.SeedInfo.seed([42012D4D1D344754]:0)
org.elasticsearch.test.TestCluster.clusterName(TestCluster.java:308)
org.elasticsearch.test.ElasticsearchIntegrationTest.beforeClass(ElasticsearchIntegrationTest.java:178)
[...sun., com.carrotsearch.randomizedtesting., java.lang.reflect.]
org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:46)
org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:42)
[...com.carrotsearch.randomizedtesting.
]
org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:43)
org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:48)
org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:70)
org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:55)
[...com.carrotsearch.randomizedtesting.*]
java.lang.Thread.run(Thread.java:745)

@nrpeterson

This comment has been minimized.

Copy link
Author

commented Aug 22, 2014

It turns out that the issue here is with Mac / Java 7: for some reason, java.net.InetAddress was returning null, causing the null pointer exception; I was able to resolve it by manually adding a new entry to my /etc/hosts.

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2014

I pushed a fix for this just to make sure you don't run into that for no reason

@clintongormley clintongormley changed the title Error loading test package Teset: Use a default host name if localAddress is not available Sep 10, 2014

@clintongormley clintongormley changed the title Teset: Use a default host name if localAddress is not available Test: Use a default host name if localAddress is not available Sep 10, 2014

@clintongormley clintongormley added >test and removed >enhancement labels Jun 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.