diff --git a/test/common/services/security/system_indices_user.ts b/test/common/services/security/system_indices_user.ts index 9bfaddd9f0306..aaec8a5b2b834 100644 --- a/test/common/services/security/system_indices_user.ts +++ b/test/common/services/security/system_indices_user.ts @@ -65,11 +65,12 @@ export async function createSystemIndicesUser(ctx: FtrProviderContext) { const log = ctx.getService('log'); const config = ctx.getService('config'); - const enabled = !config - .get('esTestCluster.serverArgs') - .some((arg: string) => arg === 'xpack.security.enabled=false'); + const enabled = !(config.get('esTestCluster.serverArgs') || []).some( + (arg: string) => arg === 'xpack.security.enabled=false' + ); + const isServerless = !!config.get('serverless'); - if (!enabled) { + if (!enabled || isServerless) { return; } diff --git a/test/common/services/security/test_user.ts b/test/common/services/security/test_user.ts index bc5dbf68698bc..2a75edf147ea4 100644 --- a/test/common/services/security/test_user.ts +++ b/test/common/services/security/test_user.ts @@ -77,10 +77,9 @@ export async function createTestUserService(ctx: FtrProviderContext, role: Role, const config = ctx.getService('config'); const enabled = - !config - .get('esTestCluster.serverArgs') - .some((arg: string) => arg === 'xpack.security.enabled=false') && - !config.get('security.disableTestUser'); + !(config.get('esTestCluster.serverArgs') || []).some( + (arg: string) => arg === 'xpack.security.enabled=false' + ) && !config.get('security.disableTestUser'); if (enabled) { log.debug('===============creating roles and users==============='); diff --git a/x-pack/test_serverless/shared/config.base.ts b/x-pack/test_serverless/shared/config.base.ts index da0efc8b4d9fc..4c7f1e89aa2e8 100644 --- a/x-pack/test_serverless/shared/config.base.ts +++ b/x-pack/test_serverless/shared/config.base.ts @@ -23,7 +23,6 @@ export default async () => { esTestCluster: { license: 'trial', from: 'snapshot', - serverArgs: ['xpack.security.enabled=false'], }, kbnTestServer: {