Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix tty and related tests (elastic#206919)
## Summary Culled from elastic#206411 This PR is informed from the work that's being done for the migration to React 18, whilst trying out kibana with react 18 we had couple of test fail relating to this particular component, details here [[job]](https://buildkite.com/elastic/kibana-pull-request/builds/266993#0194655f-1466-4ee3-80ed-54e398b09492) [[logs]](https://buildkite.com/organizations/elastic/pipelines/kibana-pull-request/builds/266993/jobs/0194655f-1466-4ee3-80ed-54e398b09492/artifacts/01946583-34ed-444a-bc55-10e684c325ef), it's worth mentioning the way the component was written causes unnecessary re-renders that doesn't actually make the interval for the tty playspeed exactly constant. The approach taken here is such that there's no need to depend on state change to cause the next line to be written, now we setup a timer interval just once for the entire duration that the tty is playing, and said timer only ever gets cleaned up on pause. P.S. This fix does not utilize any APIs from react 18 so it's backward compatible with our current version of react. ### Checklist <!-- Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] 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/src/platform/packages/shared/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 <!-- - [ ] 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 was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information