diff --git a/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java b/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java index b48744b0412..f95febbc1b3 100644 --- a/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java @@ -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 auditTrails = internalCluster().getInstances(IndexAuditTrail.class); + for (IndexAuditTrail auditTrail : auditTrails) { + auditTrail.close(); + } + } } @Test