Repository navigation
Fixes flaky server metrics collector integration tests - #121469
TinaHeiligers merged 4 commits into
Conversation
|
Pinging @elastic/kibana-core (Team:Core) |
|
@elasticmachine merge upstream |
| import { setTimeout as setTimeoutPromise } from 'timers/promises'; | ||
|
|
||
| const requestWaitDelay = 25; | ||
| const requestWaitDelay = 35; |
There was a problem hiding this comment.
Was this run against the flaky runner?
In the failing test, we are explicitly waiting until all the requests have at least been reaching the handler, via
kibana/src/core/server/metrics/integration_tests/server_collector.test.ts
Lines 97 to 102 in a7556f4
So I'm not quite sure just increase the delay where we were already waiting should really resolves the flakiness, because in theory, we should not get to the assertions because all requests have reached the server? So I'm suspecting the flakiness is appearing from elsewhere.
Maybe we should also be adding an await delay(requestWaitDelay); between await hitSubject... and let metrics = await collector.collect(); to some times for the HAPI internals?
There was a problem hiding this comment.
Was this run against the flaky runner?
The buildkite flaky test runner doesn't run jest tests yet but our Jenkins runner does 😄
https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/2162/
The metrics integration tests passed 42/42 times on 7f89ebd
So I'm suspecting the flakiness is appearing from elsewhere
I'll dig deeper...
There was a problem hiding this comment.
So, after some digging it seems like the flakiness is because the requests aren't always being triggered with supertest(hapiServer.listener).get('/disconnect).end() before the assertions.
The /disconnect router hangs on new Promise((resolve) => undefined) which is how we're mimicking the disconnection.
Even though the callback to .end is optional, I've added one anyway since we're not awaiting the request. That and the added delay should hopefully help stabilize the tests.
Flaky test runner job with these changes: https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/2163/
passed 10/10 times.
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💔 Backport failed
Successful backport PRs will be merged automatically after passing CI. To backport manually run: |
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/core/server/metrics/integration_tests/server_collector.test.ts
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/core/server/metrics/integration_tests/server_collector.test.ts
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Resolves #59234
Increases
requestWaitDelayfrom 25 to 35Adds
statusCodestometrics.requestsassertionImproves response times assertions.