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: Add ElasticsearchSingleNodeTest. #6874

Closed

Conversation

Projects
None yet
3 participants
@jpountz
Copy link
Contributor

jpountz commented Jul 15, 2014

This test makes it easy to create a lightweight node (no http, indices stored
in RAM, ...) whose main purpose is to get an instance of the Guice injector
for unit tests.

This should help not have to update lots of unit tests when we add a new
Guice dependency.

[TESTS] Add ElasticsearchSingleNodeTest.
This test makes it easy to create a lightweight node (no http, indices stored
in RAM, ...) whose main purpose is to get an instance of the Guice injector
for unit tests.

This should help not have to update lots of unit tests when we add a new
Guice dependency.
private static final Node node = node();

@After
public void after() {

This comment has been minimized.

Copy link
@s1monw

s1monw Jul 15, 2014

Contributor

I wonder if we need similar checks like we have in ElasticsearchIntegrationTest if there is no transient / persistent cluster settings chance and fail if so...?


public static Node node(Settings settings) {
return NodeBuilder.nodeBuilder().local(true).data(true).settings(ImmutableSettings.builder()
.put("cluster.name", "__single_node_")

This comment has been minimized.

Copy link
@s1monw

s1monw Jul 15, 2014

Contributor

I think we should use the ElasticsearchSingleNodeTest.class.getName() as the cluster name then we know exactly what is going on.

This comment has been minimized.

Copy link
@s1monw

s1monw Jul 15, 2014

Contributor

we should set a node name too...

@s1monw

This comment has been minimized.

Copy link
Contributor

s1monw commented Jul 15, 2014

left some small comments - thanks for doing this

@jpountz

This comment has been minimized.

Copy link
Contributor Author

jpountz commented Jul 15, 2014

@s1monw pushed a new commit

@jpountz jpountz added the review label Jul 15, 2014

@s1monw

This comment has been minimized.

Copy link
Contributor

s1monw commented Jul 15, 2014

LGTM

@s1monw

This comment has been minimized.

Copy link
Contributor

s1monw commented Jul 15, 2014

oh wait...

public static Node node(Settings settings) {
return NodeBuilder.nodeBuilder().local(true).data(true).settings(ImmutableSettings.builder()
.put(ClusterName.SETTING, ElasticsearchSingleNodeTest.class.getName())
.put("node.name", ElasticsearchSingleNodeTest.class.getName())

This comment has been minimized.

Copy link
@s1monw

s1monw Jul 15, 2014

Contributor

I think we should try to make the impact of this even lower and make all the threadpools scaling with 0s keep_alive?

@s1monw s1monw removed the review label Jul 15, 2014

@jpountz jpountz closed this Jul 15, 2014

@jpountz jpountz added v1.4.0 labels Jul 15, 2014

@clintongormley clintongormley changed the title [TESTS] Add ElasticsearchSingleNodeTest. Test: Add ElasticsearchSingleNodeTest. Sep 8, 2014

@clintongormley clintongormley removed the >feature label Jun 6, 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.