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] remove redundant tests and move to different suite #11666

Merged
merged 2 commits into from
Jul 27, 2015

Conversation

brwe
Copy link
Contributor

@brwe brwe commented Jun 15, 2015

Some of the test for meta data are redundant. Also, since they
somewhat test service disruptions (start master with empty
data folder) we might move them to DiscoveryWithServiceDisruptionsTests.
Also, this commit adds a test for
#11665

@brwe brwe force-pushed the meta-data-zen branch 3 times, most recently from 68f20f7 to f82e958 Compare June 15, 2015 16:00
String redNode = startDataNode("red");

// create blue_index on blue_node and same for red
client().admin().cluster().health(clusterHealthRequest().waitForYellowStatus().waitForNodes("3")).get();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use ensureStableCluster(3)

@brwe
Copy link
Contributor Author

brwe commented Jun 17, 2015

thanks fr the review! addressed all comments. want to have another look?

@clintongormley clintongormley added the >test Issues or PRs that are addressing/adding tests label Jun 18, 2015
@Ignore("https://github.com/elastic/elasticsearch/issues/11665")
@Test
public void testIndicesDeleted() throws Exception {
configureCluster(3, 2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want configureCluster(2, 2) for the two master nodes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this back because of this comment: #11666 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the first parameter the number of master eligible nodes or the number of all node, including data nodes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, talked to @bleskes , (3, 2) is actually correct

@bleskes
Copy link
Contributor

bleskes commented Jun 24, 2015

This looks great. Left some minor comments.

@brwe
Copy link
Contributor Author

brwe commented Jul 22, 2015

@bleskes I added a method now that lets me restart any node I want and made all other helpers I used before private again. Let me know if that is OK.

@Ignore("https://github.com/elastic/elasticsearch/issues/11665")
@Test
public void testIndicesDeleted() throws Exception {
configureCluster(2, 2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we need a configureCluster(3, 2), no?

assertThat(clusterStateResponse.getState().getMetaData().index("red_index").getState().name(), equalTo(IndexMetaData.State.OPEN.name()));
// restart again
logger.debug("relocating index...");
client().admin().indices().prepareUpdateSettings(index).setSettings(Settings.builder().put(FilterAllocationDecider.INDEX_ROUTING_INCLUDE_GROUP + "_name", node1)).get();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit pick - can we start with node1 and relocate to node2 ? :)

@bleskes
Copy link
Contributor

bleskes commented Jul 23, 2015

Thx @brwe . This looks great. I left some minor comments.

@@ -841,7 +845,9 @@ public void isolatedUnicastNodes() throws Exception {
}


/** Test cluster join with issues in cluster state publishing * */
/**
* Test cluster join with issues in cluster state publishing *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra *

@brwe
Copy link
Contributor Author

brwe commented Jul 23, 2015

@bleskes so, turns out there was a bug in the meta data write with closed indices, see brwe@f141911 . comment not so minor after all.

@bleskes
Copy link
Contributor

bleskes commented Jul 24, 2015

LGTM. Thx @brwe . Do we also want/need to add a unit test for brwe@f141911 (opening a closed index) ? (as a different change)

brwe added 2 commits July 27, 2015 12:35
Some of the test for meta data are redundant. Also, since they
somewhat test service disruptions (start master with empty
data folder) we might move them to DiscoveryWithServiceDisruptionsTests.
Also, this commit adds a test for
elastic#11665
…vant indices to write meta state

When an index is opened it will not be assigned to a node but also not have closed state
anymore. Before we only checked if an index either is closed or assigned to the data node
and therefore the change from close->open was not written.
brwe added a commit that referenced this pull request Jul 27, 2015
[TEST] remove redundant tests and move to different suite
@brwe brwe merged commit 20faccc into elastic:master Jul 27, 2015
@brwe
Copy link
Contributor Author

brwe commented Jul 27, 2015

Do we also want/need to add a unit test for brwe/elasticsearch@f141911 (opening a closed index) ? (as a different change)

Yes, I think we should. I opened #12475 to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>test Issues or PRs that are addressing/adding tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants