-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Uptime] Unskip alert functional test #101562
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,10 @@ | |
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we don't need to maintain our own delay function. |
||
|
||
export default ({ getPageObjects, getService }: FtrProviderContext) => { | ||
// FLAKY: https://github.com/elastic/kibana/issues/88177 | ||
describe.skip('uptime alerts', () => { | ||
describe('uptime alerts', () => { | ||
const pageObjects = getPageObjects(['common', 'uptime']); | ||
const supertest = getService('supertest'); | ||
const retry = getService('retry'); | ||
|
@@ -91,11 +91,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |
// put the fetch code in a retry block with a timeout. | ||
let alert: any; | ||
await retry.tryForTime(60 * 1000, async () => { | ||
// add a delay before next call to not overload the server | ||
await delay(1500); | ||
const apiResponse = await supertest.get('/api/alerts/_find?search=uptime-test'); | ||
const alertsFromThisTest = apiResponse.body.data.filter( | ||
({ name }: { name: string }) => name === 'uptime-test' | ||
); | ||
expect(alertsFromThisTest).to.have.length(1); | ||
expect(alertsFromThisTest.length >= 1).to.be(true); | ||
alert = alertsFromThisTest[0]; | ||
}); | ||
|
||
|
@@ -124,7 +126,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { | |
expect(timerangeUnit).to.be('h'); | ||
expect(timerangeCount).to.be(1); | ||
expect(JSON.stringify(filters)).to.eql( | ||
`{"url.port":["5678"],"observer.geo.name":["mpls"],"monitor.type":["http"],"tags":[]}` | ||
`{"tags":[],"url.port":["5678"],"observer.geo.name":["mpls"],"monitor.type":["http"]}` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a need for this change or just the result of doing some testing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, seems like the order has changed. |
||
); | ||
} finally { | ||
await supertest.delete(`/api/alerts/alert/${id}`).set('kbn-xsrf', 'true').expect(204); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍