-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
let list = await response.json() | ||
|
||
expect(list.filter((i) => i.name.startsWith(`${namePrefix}${testPrefix}`)).length).toBe(3) | ||
|
||
response = await request.delete(`/v1/monitoring-instances/${name}`) | ||
expect(response.ok()).toBeTruthy() | ||
|
||
response = await request.get('/v1/monitoring-instances') | ||
expect(response.ok()).toBeTruthy() | ||
list = await response.json() | ||
|
||
expect(list.filter((i) => i.name.startsWith(`${namePrefix}${testPrefix}`)).length).toBe(2) |
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.
This logic was in place intentionally.
I discovered we had a bug in the implementation where delete would delete the first instance, not the one selected by name
.
I suggest we keep this in place.
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.
Thanks for pointing that corner case out! The test is updated to handle it again. Also added a comment to avoid such confusions in the future.
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.
I left a small comment about a potential issue with the tests.
Feel free to address if you think it's relevant.
}) | ||
|
||
test('get monitoring instance', async ({ request }) => { | ||
const namePrefix = 'get-' |
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.
This was in place for the same purpose - making sure we don't return the first entry instead of the correct one.
not relevant anymore, fixed by #431 |
Fix flaky tests
Problem:
EVEREST-478
In the backend repo there are several flaky tests for monitoring and backup-storages
Solution
Add random naming and cleanup