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

Serverless Observability project failing test: "Search source Alert should show time field validation error" #203045

Open
lukasolson opened this issue Dec 5, 2024 · 4 comments
Labels
bug Fixes for quality problems that affect the customer experience failed-test A test failure on a tracked branch, potentially flaky-test Team:obs-ux-management Observability Management User Experience Team

Comments

@lukasolson
Copy link
Member

lukasolson commented Dec 5, 2024

Describe the bug:

Serverless Observability project search rule creation allows creating rule without time-based index pattern

Steps to reproduce:

  1. Create a data view that has no time field
  2. Open Discover in an Observability project
  3. Click "Alerts" then "Create custom threshold rule"
  4. Make sure the data view without a time field is selected (notice the error message flickering)
  5. Save the alert

Expected behavior:

An error & not being able to save the alert.

Screenshots (if relevant):

Here's a video showing the expected behavior (from Discover, not being able to save the alert):

Screen.Recording.2024-12-04.at.9.30.48.PM.mov

Here's what happens in the observability project:

Screen.Recording.2024-12-04.at.9.29.45.PM.mov

Any additional context:

This came up as part of #196443 which re-enables some tests that were previously skipped. This test started failing (because it seems to be an actual bug):

it('should show time field validation error', async () => {
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.waitUntilSearchingHasFinished();
await dataViews.switchToAndValidate(SOURCE_DATA_VIEW);
await PageObjects.timePicker.setCommonlyUsedTime('Last_15 minutes');
await openDiscoverAlertFlyout();
await defineSearchSourceAlert(RULE_NAME);
await testSubjects.click('selectDataViewExpression');
await testSubjects.existOrFail('indexPattern-switcher--input');
await testSubjects.click('indexPattern-switcher--input');
const input = await find.activeElement();
// search-source-alert-output index does not have time field
await input.type('search-source-alert-o*');
await testSubjects.existOrFail('explore-matching-indices-button');
await testSubjects.click('explore-matching-indices-button');
await retry.waitFor('selection to happen', async () => {
const dataViewSelector = await testSubjects.find('selectDataViewExpression');
return (await dataViewSelector.getVisibleText()) === 'DATA VIEW\nsearch-source-alert-o*';
});
await testSubjects.click('saveRuleButton');
const errorElem = await testSubjects.find('esQueryAlertExpressionError');
const errorText = await errorElem.getVisibleText();
expect(errorText).to.eql('Data view should have a time field.');
});

@lukasolson lukasolson added bug Fixes for quality problems that affect the customer experience failed-test A test failure on a tracked branch, potentially flaky-test Team:obs-ux-logs Observability Logs User Experience Team Team:obs-ux-management Observability Management User Experience Team labels Dec 5, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

@maryam-saeidi
Copy link
Member

Just to double-check, are you sure the selected data view does not have a time field? How did you create that data view?

We show the following error despite not disabling the save button:

@lukasolson lukasolson changed the title Observability project failing test: "Search source Alert should show time field validation error" Serverless Observability project failing test: "Search source Alert should show time field validation error" Dec 5, 2024
@lukasolson
Copy link
Member Author

Updated the original issue to describe this is limited to serverless observability (probably related to #198987)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience failed-test A test failure on a tracked branch, potentially flaky-test Team:obs-ux-management Observability Management User Experience Team
Projects
None yet
Development

No branches or pull requests

4 participants