Test: stop the IndexAuditTrail if running to prevent locked shards

The InternalTestCluster checks after the tests run if there are any locked shards, which is still
possible because the IndexAuditTrail is running and auditing events. This change makes the
test stop the IndexAuditTrail if they are running in the local cluster.

Original commit: elastic/x-pack-elasticsearch@f7fb564525
This commit is contained in:
jaymode 2015-09-03 13:00:42 -04:00
parent 1dbdf2ea1f
commit 480406ebc7
1 changed files with 8 additions and 0 deletions

View File

@ -113,6 +113,14 @@ public class RemoteIndexAuditTrailStartingTests extends ShieldIntegTestCase {
}
remoteCluster.close();
}
// stop the index audit trail so that the shards aren't locked causing the test to fail
if (outputs.contains("index")) {
Iterable<IndexAuditTrail> auditTrails = internalCluster().getInstances(IndexAuditTrail.class);
for (IndexAuditTrail auditTrail : auditTrails) {
auditTrail.close();
}
}
}
@Test