Test: TokenAuthIntegTests ensures security index writable before invalidating
This commit makes sure the TokenAuthIntegTests wait for the security index to be writable before
each test method as invalidation requires writing to the security index.
Relates elastic/x-pack-elasticsearch#1551
Original commit: elastic/x-pack-elasticsearch@6e2288510259210ee1505bbd0a8795593ef47c4a
@@ -21,6 +21,7 @@ import org.elasticsearch.xpack.security.action.token.CreateTokenResponse;
import org.elasticsearch.xpack.security.action.token.InvalidateTokenResponse;
import org.elasticsearch.xpack.security.client.SecurityClient;
import org.junit.After;
+import org.junit.Before;
import java.io.IOException;
import java.io.UncheckedIOException;
@@ -112,6 +113,11 @@ public class TokenAuthIntegTests extends SecurityIntegTestCase {
}
}
+ @Before
+ public void waitForSecurityIndexWritable() throws Exception {
+ assertSecurityIndexWriteable();
+ }
+
@After
public void wipeSecurityIndex() throws InterruptedException {
// get the token service and wait until token expiration is not in progress!
