HomePhabricator

ElasticV7QueryChangesTest: Close indices after test

Authored by David Pursehouse <dpursehouse@collab.net> on Dec 3 2018, 12:27 PM.

Description

ElasticV7QueryChangesTest: Close indices after test

For each test method, new indices are created with a unique name based
on the test method name. This results in 3 indices (i.e. one each for
accounts, changes and groups) for each test method that is run, which
in turn results in the number of allocated shards increasing.

In Elasticsearch 7.0 a shard limit is introduced [1] which so far only
causes a warning. However in a future version (not clear if this means
the final 7.0 release or a subsequent one) the limit will be enforced
and result in an error.

After each test, close the indices that were created. This results in
the shards being deallocated, and prevents exceeding the limit.

[1] https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-7.0.html#_cluster_wide_shard_soft_limit

Bug: Issue 10120
Change-Id: I6644cf9ee84a6133005d07c2310761707a74b96c

Event Timeline

David Pursehouse <dpursehouse@collab.net> committed rGERRITDEPLOYb9d00d08759f: ElasticV7QueryChangesTest: Close indices after test (authored by David Pursehouse <dpursehouse@collab.net>).Dec 3 2018, 11:32 PM