Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Obs AI Assistant] Add retry statements as an attempt to resolve flaky tests #200022

Conversation

viduni94
Copy link
Contributor

@viduni94 viduni94 commented Nov 13, 2024

Closes #192222

Summary

Problem

The test appears to be flaky, potentially because the entries are not available at the time of retrieval. This cannot be reproduced locally or via the flaky test runner. (more details here)

Solution

Add a retry when fetching the instructions and check whether the number of instructions returned by the API endpoint is the same number of instructions expected.

Checklist

@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Nov 13, 2024
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 13, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: 60f4376
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-200022-60f43766c5cf

Metrics [docs]

✅ unchanged

History

cc @viduni94


const instructions = res.body.userInstructions;
const instructions = res.body.userInstructions;
expect(instructions).to.have.length(3);
Copy link
Member

@sorenlouv sorenlouv Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does expect actually throw and is able to be caught and retried? If so, good!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, based on the below example, where I made expect(instructions).to.have.length(2); - which should throw an error.

Screenshot 2024-11-13 at 6 07 55 PM Screenshot 2024-11-13 at 6 08 06 PM

@viduni94 viduni94 merged commit 53c05a3 into elastic:main Nov 14, 2024
23 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11841064792

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 14, 2024
…y tests (elastic#200022)

Closes elastic#192222

## Summary

### Problem
The test appears to be flaky, potentially because the entries are not
available at the time of retrieval. This cannot be reproduced locally or
via the flaky test runner. (more details
[here](elastic#196026 (comment)))

### Solution
Add a retry when fetching the instructions and check whether the number
of instructions returned by the API endpoint is the same number of
instructions expected.

### Checklist

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

(cherry picked from commit 53c05a3)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 14, 2024
…e flaky tests (#200022) (#200213)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Obs AI Assistant] Add retry statements as an attempt to resolve
flaky tests (#200022)](#200022)

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

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

<!--BACKPORT [{"author":{"name":"Viduni
Wickramarachchi","email":"viduni.wickramarachchi@elastic.co"},"sourceCommit":{"committedDate":"2024-11-14T16:09:42Z","message":"[Obs
AI Assistant] Add retry statements as an attempt to resolve flaky tests
(#200022)\n\nCloses
https://github.com/elastic/kibana/issues/192222\r\n\r\n##
Summary\r\n\r\n### Problem\r\nThe test appears to be flaky, potentially
because the entries are not\r\navailable at the time of retrieval. This
cannot be reproduced locally or\r\nvia the flaky test runner. (more
details\r\n[here](https://github.com/elastic/kibana/pull/196026#issuecomment-2409056856))\r\n\r\n###
Solution\r\nAdd a retry when fetching the instructions and check whether
the number\r\nof instructions returned by the API endpoint is the same
number of\r\ninstructions expected.\r\n\r\n### Checklist\r\n\r\n- [x]
[Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"53c05a33e7fe917b7d64b7d3ca664aaf3f9cf3ca","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","Team:Obs
AI
Assistant","ci:project-deploy-observability","backport:version","v8.17.0"],"title":"[Obs
AI Assistant] Add retry statements as an attempt to resolve flaky
tests","number":200022,"url":"https://github.com/elastic/kibana/pull/200022","mergeCommit":{"message":"[Obs
AI Assistant] Add retry statements as an attempt to resolve flaky tests
(#200022)\n\nCloses
https://github.com/elastic/kibana/issues/192222\r\n\r\n##
Summary\r\n\r\n### Problem\r\nThe test appears to be flaky, potentially
because the entries are not\r\navailable at the time of retrieval. This
cannot be reproduced locally or\r\nvia the flaky test runner. (more
details\r\n[here](https://github.com/elastic/kibana/pull/196026#issuecomment-2409056856))\r\n\r\n###
Solution\r\nAdd a retry when fetching the instructions and check whether
the number\r\nof instructions returned by the API endpoint is the same
number of\r\ninstructions expected.\r\n\r\n### Checklist\r\n\r\n- [x]
[Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"53c05a33e7fe917b7d64b7d3ca664aaf3f9cf3ca"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200022","number":200022,"mergeCommit":{"message":"[Obs
AI Assistant] Add retry statements as an attempt to resolve flaky tests
(#200022)\n\nCloses
https://github.com/elastic/kibana/issues/192222\r\n\r\n##
Summary\r\n\r\n### Problem\r\nThe test appears to be flaky, potentially
because the entries are not\r\navailable at the time of retrieval. This
cannot be reproduced locally or\r\nvia the flaky test runner. (more
details\r\n[here](https://github.com/elastic/kibana/pull/196026#issuecomment-2409056856))\r\n\r\n###
Solution\r\nAdd a retry when fetching the instructions and check whether
the number\r\nof instructions returned by the API endpoint is the same
number of\r\ninstructions expected.\r\n\r\n### Checklist\r\n\r\n- [x]
[Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"53c05a33e7fe917b7d64b7d3ca664aaf3f9cf3ca"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Viduni Wickramarachchi <viduni.wickramarachchi@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment