Skip to content

Commit

Permalink
[8.14] Adjust esClient parameters to prevent flaky behaviors (elastic…
Browse files Browse the repository at this point in the history
…#181566) (elastic#181676)

# Backport

This will backport the following commits from `main` to `8.14`:
- [Adjust esClient parameters to prevent flaky behaviors
(elastic#181566)](elastic#181566)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Gerard
Soldevila","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-04-25T09:37:37Z","message":"Adjust
esClient parameters to prevent flaky behaviors (elastic#181566)\n\n##
Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/152677\r\n\r\nIt seems that CI
eventually times out whilst creating SO indices for\r\ntesting
purposes.\r\nThe PR aims at preventing this by increasing that timeout
from `5.5s` to\r\n`10s`.\r\n\r\n\r\nLast 4 CI failures report the exact
same `Request timed out` error:\r\n\r\n<img width=\"1037\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/25349407/8b4856f7-d667-4e95-b623-a085ab756e84\">\r\n\r\n---\r\n\r\nFixes
https://github.com/elastic/kibana/issues/167288\r\n\r\nThe PIT ids are
much longer on serverless. This causes issues with some\r\nour tests,
which were checking response sizes.\r\nPR
elastic#180261 attempted at fixing
it,\r\nbut the parameters were not properly adjusted, because the tests
first\r\ndo a valid request, followed by an invalid
one.","sha":"75c228c4ea5eea1c6c87218382bafea827a185b9","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","test-failure-flaky","backport:prev-minor","v8.15.0"],"title":"Adjust
esClient parameters to prevent flaky
behaviors","number":181566,"url":"https://github.com/elastic/kibana/pull/181566","mergeCommit":{"message":"Adjust
esClient parameters to prevent flaky behaviors (elastic#181566)\n\n##
Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/152677\r\n\r\nIt seems that CI
eventually times out whilst creating SO indices for\r\ntesting
purposes.\r\nThe PR aims at preventing this by increasing that timeout
from `5.5s` to\r\n`10s`.\r\n\r\n\r\nLast 4 CI failures report the exact
same `Request timed out` error:\r\n\r\n<img width=\"1037\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/25349407/8b4856f7-d667-4e95-b623-a085ab756e84\">\r\n\r\n---\r\n\r\nFixes
https://github.com/elastic/kibana/issues/167288\r\n\r\nThe PIT ids are
much longer on serverless. This causes issues with some\r\nour tests,
which were checking response sizes.\r\nPR
elastic#180261 attempted at fixing
it,\r\nbut the parameters were not properly adjusted, because the tests
first\r\ndo a valid request, followed by an invalid
one.","sha":"75c228c4ea5eea1c6c87218382bafea827a185b9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/181566","number":181566,"mergeCommit":{"message":"Adjust
esClient parameters to prevent flaky behaviors (elastic#181566)\n\n##
Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/152677\r\n\r\nIt seems that CI
eventually times out whilst creating SO indices for\r\ntesting
purposes.\r\nThe PR aims at preventing this by increasing that timeout
from `5.5s` to\r\n`10s`.\r\n\r\n\r\nLast 4 CI failures report the exact
same `Request timed out` error:\r\n\r\n<img width=\"1037\"
alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/25349407/8b4856f7-d667-4e95-b623-a085ab756e84\">\r\n\r\n---\r\n\r\nFixes
https://github.com/elastic/kibana/issues/167288\r\n\r\nThe PIT ids are
much longer on serverless. This causes issues with some\r\nour tests,
which were checking response sizes.\r\nPR
elastic#180261 attempted at fixing
it,\r\nbut the parameters were not properly adjusted, because the tests
first\r\ndo a valid request, followed by an invalid
one.","sha":"75c228c4ea5eea1c6c87218382bafea827a185b9"}}]}] BACKPORT-->

Co-authored-by: Gerard Soldevila <[email protected]>
  • Loading branch information
kibanamachine and gsoldevila authored Apr 25, 2024
1 parent 0737cb5 commit 3a0af1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('migration actions', () => {
beforeAll(async () => {
esServer = await startES();
// we don't need a long timeout for testing purposes
client = esServer.es.getClient().child({ ...MIGRATION_CLIENT_OPTIONS, requestTimeout: 5500 });
client = esServer.es.getClient().child({ ...MIGRATION_CLIENT_OPTIONS, requestTimeout: 10_000 });
esCapabilities = elasticsearchServiceMock.createCapabilities();

// Create test fixture data:
Expand Down Expand Up @@ -390,8 +390,7 @@ describe('migration actions', () => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/152677
describe.skip('waitForIndexStatus', () => {
describe('waitForIndexStatus', () => {
afterEach(async () => {
try {
await client.indices.delete({ index: 'red_then_yellow_index' });
Expand Down Expand Up @@ -1309,7 +1308,7 @@ describe('migration actions', () => {
query: { match_all: {} },
batchSize: 1, // small batch size so we don't exceed the maxResponseSize
searchAfter: undefined,
maxResponseSizeBytes: 1000, // set a small size to force the error
maxResponseSizeBytes: 5000, // make sure long ids don't cause es_response_too_large
});
const rightResponse = await readWithPitTask();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,7 @@ export const runActionTestSuite = ({
);
});

// FLAKY: https://github.com/elastic/kibana/issues/167288
it.skip('returns a left es_response_too_large error when a read batch exceeds the maxResponseSize', async () => {
it('returns a left es_response_too_large error when a read batch exceeds the maxResponseSize', async () => {
const openPitTask = openPit({ client, index: 'existing_index_with_docs' });
const pitResponse = (await openPitTask()) as Either.Right<OpenPitResponse>;

Expand All @@ -1359,7 +1358,7 @@ export const runActionTestSuite = ({
query: { match_all: {} },
batchSize: 1, // small batch size so we don't exceed the maxResponseSize
searchAfter: undefined,
maxResponseSizeBytes: 1000, // set a small size to force the error
maxResponseSizeBytes: 5000, // make sure long ids don't cause es_response_too_large
});
const rightResponse = await readWithPitTask();

Expand Down

0 comments on commit 3a0af1b

Please sign in to comment.