Skip to content

Commit

Permalink
[Search Sessions] Fix flaky partial results test in search examples (e…
Browse files Browse the repository at this point in the history
…lastic#155816)

## Summary

Unskip and fix flaky partial results test in search examples plugin.

Flaky test runner x100:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2172.

Fixes elastic#116038.

### Checklist

- [ ] ~Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
- [ ]
~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] ~Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
- [ ] ~Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
- [ ] ~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [ ] ~This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
- [ ] ~This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
  • Loading branch information
davismcphee authored Apr 27, 2023
1 parent 69755a9 commit 11a80ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions examples/search_examples/server/fibonacci_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { v4 as uuidv4 } from 'uuid';
import { ISearchStrategy } from '@kbn/data-plugin/server';
import { of } from 'rxjs';
import { FibonacciRequest, FibonacciResponse } from '../common/types';

export const fibonacciStrategyProvider = (): ISearchStrategy<
Expand Down Expand Up @@ -40,10 +41,7 @@ export const fibonacciStrategyProvider = (): ISearchStrategy<
const took = Date.now() - started;
const values = sequence.slice(0, loaded);

// Usually we'd do something like "of()" but for some reason it breaks in tests with the error
// "You provided an invalid object where a stream was expected." which is why we have to cast
// down below as well
return [{ id, loaded, total, isRunning, isPartial, rawResponse: { took, values } }];
return of({ id, loaded, total, isRunning, isPartial, rawResponse: { took, values } });
},
cancel: async (id: string) => {
responseMap.delete(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common']);
const retry = getService('retry');

// FLAKY: https://github.com/elastic/kibana/issues/116038
describe.skip('Partial results example', () => {
describe('Partial results example', () => {
before(async () => {
await PageObjects.common.navigateToApp('searchExamples');
await testSubjects.click('/search');
Expand Down

0 comments on commit 11a80ce

Please sign in to comment.