From 155a8d0ca2935d7737973a2cfcc863dc8191f4e2 Mon Sep 17 00:00:00 2001 From: Davis McPhee Date: Tue, 25 Apr 2023 22:19:23 -0300 Subject: [PATCH] Fix flaky search examples partial results test --- examples/search_examples/server/fibonacci_strategy.ts | 6 ++---- .../examples/search_examples/partial_results_example.ts | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/search_examples/server/fibonacci_strategy.ts b/examples/search_examples/server/fibonacci_strategy.ts index 8317834dcbb3d4..8a33872cdb7e72 100644 --- a/examples/search_examples/server/fibonacci_strategy.ts +++ b/examples/search_examples/server/fibonacci_strategy.ts @@ -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< @@ -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); diff --git a/x-pack/test/examples/search_examples/partial_results_example.ts b/x-pack/test/examples/search_examples/partial_results_example.ts index f7d199463e2568..269b2e79ab38f7 100644 --- a/x-pack/test/examples/search_examples/partial_results_example.ts +++ b/x-pack/test/examples/search_examples/partial_results_example.ts @@ -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');