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

[Discover] Fix flakiness of context filters test #67923

Closed
Closed
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 test/functional/apps/context/_date_nanos.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export default function({ getService, getPageObjects }) {
return esArchiver.unload('date_nanos');
});

// https://github.com/elastic/kibana/issues/58815
it.skip('displays predessors - anchor - successors in right order ', async function() {
it('displays predessors - anchor - successors in right order ', async function() {
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, 'AU_x3-TaGFA8no6Qj999Z');
const actualRowsText = await docTable.getRowsText();
const expectedRowsText = [
Expand Down
34 changes: 17 additions & 17 deletions test/functional/apps/context/_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* under the License.
*/

import expect from '@kbn/expect';

const TEST_INDEX_PATTERN = 'logstash-*';
const TEST_ANCHOR_ID = 'AU_x3_BrGFA8no6QjjaI';
const TEST_ANCHOR_FILTER_FIELD = 'geo.src';
Expand All @@ -40,20 +38,19 @@ export default function({ getService, getPageObjects }) {
});

it('inclusive filter should be addable via expanded doc table rows', async function() {
await docTable.toggleRowExpanded({ isAnchorRow: true });

await retry.try(async () => {
await retry.waitFor(`filter ${TEST_ANCHOR_FILTER_FIELD} in filterbar`, async () => {
await docTable.toggleRowExpanded({ isAnchorRow: true });
const anchorDetailsRow = await docTable.getAnchorDetailsRow();
await docTable.addInclusiveFilter(anchorDetailsRow, TEST_ANCHOR_FILTER_FIELD);
await PageObjects.context.waitUntilContextLoadingHasFinished();
expect(
await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, true)
).to.be(true);

return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, true);
});
await retry.waitFor(`filter matching docs in docTable`, async () => {
const fields = await docTable.getFields();
const hasOnlyFilteredRows = fields
return fields
.map(row => row[2])
.every(fieldContent => fieldContent === TEST_ANCHOR_FILTER_VALUE);
expect(hasOnlyFilteredRows).to.be(true);
});
});

Expand All @@ -64,26 +61,29 @@ export default function({ getService, getPageObjects }) {
await filterBar.toggleFilterEnabled(TEST_ANCHOR_FILTER_FIELD);
await PageObjects.context.waitUntilContextLoadingHasFinished();

retry.try(async () => {
expect(
await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, false)
).to.be(true);
await retry.waitFor(`a disabled filter in filterbar`, async () => {
return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, TEST_ANCHOR_FILTER_VALUE, false);
});

await retry.waitFor('filters are disabled', async () => {
const fields = await docTable.getFields();
const hasOnlyFilteredRows = fields
.map(row => row[2])
.every(fieldContent => fieldContent === TEST_ANCHOR_FILTER_VALUE);
expect(hasOnlyFilteredRows).to.be(false);
return hasOnlyFilteredRows === false;
});

retry.try(async () => {});
});

it('filter for presence should be addable via expanded doc table rows', async function() {
await docTable.toggleRowExpanded({ isAnchorRow: true });

await retry.try(async () => {
await retry.waitFor('an exists filter in the filterbar', async () => {
const anchorDetailsRow = await docTable.getAnchorDetailsRow();
await docTable.addExistsFilter(anchorDetailsRow, TEST_ANCHOR_FILTER_FIELD);
await PageObjects.context.waitUntilContextLoadingHasFinished();
expect(await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, 'exists', true)).to.be(true);
return await filterBar.hasFilter(TEST_ANCHOR_FILTER_FIELD, 'exists', true);
});
});
});
Expand Down