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:
parent
1dbdf2ea1f
commit
480406ebc7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue