Enable debug logging in FileSettingsRoleMappingsStartupIT (#99247)

investigating failing tests

relates #98391
This commit is contained in:
Przemyslaw Gomulka 2023-09-08 13:26:24 +02:00 committed by GitHub
parent 443c53c636
commit f5871af929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,7 @@ import org.elasticsearch.reservedstate.service.FileSettingsService;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.InternalSettingsPlugin;
import org.elasticsearch.test.SecurityIntegTestCase;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.transport.netty4.Netty4Plugin;
import org.elasticsearch.xpack.wildcard.Wildcard;
@ -111,16 +112,19 @@ public class FileSettingsRoleMappingsStartupIT extends SecurityIntegTestCase {
return new Tuple<>(savedClusterState, metadataVersion);
}
@TestLogging(value = "org.elasticsearch.common.file:DEBUG", reason = "https://github.com/elastic/elasticsearch/issues/98391")
public void testFailsOnStartMasterNodeWithError() throws Exception {
internalCluster().setBootstrapMasterNodeIndex(0);
internalCluster().startMasterOnlyNode();
logger.info("--> write some role mappings, no other file settings");
writeJSONFile(internalCluster().getMasterName(), testJSONForFailedCase);
var savedClusterState = setupClusterStateListenerForError(internalCluster().getMasterName());
boolean awaitSuccessful = savedClusterState.v1().await(20, TimeUnit.SECONDS);
assertTrue(awaitSuccessful);
fail();
}
public Collection<Class<? extends Plugin>> nodePlugins() {