Skip to content

Commit

Permalink
Fix unknown product test flaky behavior (elastic#148616)
Browse files Browse the repository at this point in the history
Fixes elastic#129754

The failing integration test is querying the `/api/status` endpoint
before Kibana and ES are completely initialized, and thus, it is getting
a _unavailable: Waiting for Elasticsearch_ instead of the expected
_critical_.

The proposed fix consists in awaiting a few milliseconds, in order to
give the `debounceTime` operators enough time to propagate the right
status.

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
2 people authored and jennypavlova committed Jan 13, 2023
1 parent 9588c8b commit 948be95
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function createFakeElasticsearchServer() {
}

// FLAKY: https://github.com/elastic/kibana/issues/129754
describe.skip('fake elasticsearch', () => {
describe('fake elasticsearch', () => {
let esServer: http.Server;
let kibanaServer: Root;
let kibanaHttpServer: http.Server;
Expand All @@ -81,6 +81,10 @@ describe.skip('fake elasticsearch', () => {
const kibanaPreboot = await kibanaServer.preboot();
kibanaHttpServer = kibanaPreboot.http.server.listener; // Mind that we are using the prebootServer at this point because the migration gets hanging, while waiting for ES to be correct
await kibanaServer.setup();
// give kibanaServer's status Observables enough time to bootstrap
// and emit a status after the initial "unavailable: Waiting for Elasticsearch"
// see https://github.com/elastic/kibana/issues/129754
await new Promise((resolve) => setTimeout(resolve, 500));
});

afterAll(async () => {
Expand Down

0 comments on commit 948be95

Please sign in to comment.