Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FTR] Stabilize SSLP functional tests #102553

Merged
merged 1 commit into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/kbn-es-archiver/src/actions/empty_kibana_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ export async function emptyKibanaIndexAction({
kbnClient: KbnClient;
}) {
const stats = createStats('emptyKibanaIndex', log);
const kibanaPluginIds = await kbnClient.plugins.getEnabledIds();

await cleanKibanaIndices({ client, stats, log, kibanaPluginIds });
await cleanKibanaIndices({ client, stats, log });
await migrateKibanaIndex(kbnClient);
stats.createdIndex('.kibana');
return stats.toJSON();
Expand Down
3 changes: 1 addition & 2 deletions packages/kbn-es-archiver/src/actions/unload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export async function unloadAction({
}) {
const name = relative(REPO_ROOT, inputDir);
const stats = createStats(name, log);
const kibanaPluginIds = await kbnClient.plugins.getEnabledIds();

const files = prioritizeMappings(await readDirectory(inputDir));
for (const filename of files) {
Expand All @@ -47,7 +46,7 @@ export async function unloadAction({
createReadStream(resolve(inputDir, filename)) as Readable,
...createParseArchiveStreams({ gzip: isGzip(filename) }),
createFilterRecordsStream('index'),
createDeleteIndexStream(client, stats, log, kibanaPluginIds),
createDeleteIndexStream(client, stats, log),
] as [Readable, ...Writable[]]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('esArchiver: createDeleteIndexStream()', () => {

await createPromiseFromStreams([
createListStream([createStubIndexRecord('index1')]),
createDeleteIndexStream(client, stats, log, []),
createDeleteIndexStream(client, stats, log),
]);

sinon.assert.notCalled(stats.deletedIndex as sinon.SinonSpy);
Expand All @@ -43,7 +43,7 @@ describe('esArchiver: createDeleteIndexStream()', () => {

await createPromiseFromStreams([
createListStream([createStubIndexRecord('index1')]),
createDeleteIndexStream(client, stats, log, []),
createDeleteIndexStream(client, stats, log),
]);

sinon.assert.calledOnce(stats.deletedIndex as sinon.SinonSpy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ import { Stats } from '../stats';
import { deleteIndex } from './delete_index';
import { cleanKibanaIndices } from './kibana_index';

export function createDeleteIndexStream(
client: KibanaClient,
stats: Stats,
log: ToolingLog,
kibanaPluginIds: string[]
) {
export function createDeleteIndexStream(client: KibanaClient, stats: Stats, log: ToolingLog) {
return new Transform({
readableObjectMode: true,
writableObjectMode: true,
Expand All @@ -29,7 +24,7 @@ export function createDeleteIndexStream(
const { index } = record.value;

if (index.startsWith('.kibana')) {
await cleanKibanaIndices({ client, stats, log, kibanaPluginIds });
await cleanKibanaIndices({ client, stats, log });
} else {
await deleteIndex({ client, stats, log, index });
}
Expand Down
10 changes: 0 additions & 10 deletions packages/kbn-es-archiver/src/lib/indices/kibana_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,11 @@ export async function cleanKibanaIndices({
client,
stats,
log,
kibanaPluginIds,
}: {
client: KibanaClient;
stats: Stats;
log: ToolingLog;
kibanaPluginIds: string[];
}) {
if (!kibanaPluginIds.includes('spaces')) {
return await deleteKibanaIndices({
client,
stats,
log,
});
}

while (true) {
const resp = await client.deleteByQuery(
{
Expand Down
7 changes: 6 additions & 1 deletion test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ export default async function ({ readConfigFile }) {
serverArgs: [
...commonConfig.get('kbnTestServer.serverArgs'),
'--telemetry.optIn=false',
'--xpack.security.enabled=false',
'--savedObjects.maxImportPayloadBytes=10485760',
'--xpack.maps.showMapVisualizationTypes=true',

// to be re-enabled once kibana/issues/102552 is completed
'--xpack.security.enabled=false',
'--monitoring.enabled=false',
'--xpack.reporting.enabled=false',
'--enterpriseSearch.enabled=false',
],
},

Expand Down