Skip to content

Commit

Permalink
[docs] Add comment about ftr test environment differences (elastic#16…
Browse files Browse the repository at this point in the history
…9596)

Skipped tests are release blockers and fixing flaky tests isn't always
easy, especially if we assume that if a test passes locally, it will
also pass in CI.

We need to keep the differences between our local environments and CI in
mind and make appropriate changes that take these differences into
account but to do that, we first need to know what these differences
are!

This PR adds a high level description of a couple of key differences.

### Checklist

Delete any items that are not applicable to this PR.

- [X] 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)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials

---------

Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
  • Loading branch information
TinaHeiligers and afharo authored Oct 24, 2023
1 parent 6cf6e61 commit 456d980
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev_docs/operations/writing_stable_functional_tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Consistently writing functional tests that aren't flaky is impossible. There are

When you watch tests execute locally it can be tempting to think "after I click this button I can click this other button" but this assumes that the first button click will always execute its click handler immediately, or that the render of the second button will be done immediately. The reality is that user interfaces are super complex and these types of assumptions are by far the most common cause of flakiness in tests.

We also have to remember that we can't assume a test passing locally will mean it will pass in CI. The two environments are different. There is a lot we could mention, but at a high level, most functional tests are run on 4 core 16 GB machines, and these machines are virtualized, which means neighbors can cause modest but variable levels of performance. Additionally, end-to-end tests in CI are run against {kib} distributions, using default memory configurations, while we run the tests under the `--dev` flag locally with, most likely, a different memory configuration.

There are all sorts of things that can happen to delay a click handler, or react render, and we need to be prepared for those in our tests. We can do this using appropriate timeouts for specific actions, retry logic, and validating our assumptions with code.

## Become familiar with the retry/timing logic of each common service method
Expand Down

0 comments on commit 456d980

Please sign in to comment.